diff --git a/vasl_templates/webapp/snippets.py b/vasl_templates/webapp/snippets.py index 359547c..f3d7744 100644 --- a/vasl_templates/webapp/snippets.py +++ b/vasl_templates/webapp/snippets.py @@ -216,7 +216,7 @@ def get_flag( nat ): with app.open_resource( fname, "rb" ) as fp: return _get_small_image( fp, key, height ) except FileNotFoundError: - if nat in globvars.template_pack["nationalities"]: + if nat in globvars.template_pack["nationalities"] and not request.args.get("no-spacer"): # NOTE: If the nationalitity is valid but has no flag, we return a spacer image, so that # the scenario card doesn't show a "broken image" image. fname = os.path.join( "static/images/spacer.png" ) diff --git a/vasl_templates/webapp/static/css/main.css b/vasl_templates/webapp/static/css/main.css index 61d3402..8dc35e5 100644 --- a/vasl_templates/webapp/static/css/main.css +++ b/vasl_templates/webapp/static/css/main.css @@ -43,7 +43,7 @@ button.edit-template img { height: 18px ; vertical-align: middle ; margin-right: input.snippet-width { width: 3.75em ; } .ui-dialog-titlebar { padding: 0.2em 0.5em 0.2em 0.5em !important ; } -.ui-dialog-titlebar img.flag { height: 0.9em ; margin: -2px 0.25em 0 0 ; } +.ui-dialog-titlebar img.flag { height: 0.9em ; margin: -2px 0.4em 0 0 ; } .ui-dialog-titlebar-close { margin-top: -10px !important ; } .ui-dialog-content { padding: 1em !important ; } .ui-dialog-content p { margin-bottom: 0.5em ; } diff --git a/vasl_templates/webapp/static/css/tabs.css b/vasl_templates/webapp/static/css/tabs.css index d533d7b..8ca146e 100644 --- a/vasl_templates/webapp/static/css/tabs.css +++ b/vasl_templates/webapp/static/css/tabs.css @@ -8,8 +8,9 @@ #tabs .ui-tabs-nav { background: white ; border: none ; } #tabs .ui-tabs-nav a { color: #888 ; } #tabs .ui-tabs-nav a:hover { color: #444 ; } +#tabs .ui-tabs-anchor { display: flex ; align-items: center ; } #tabs .ui-tabs-tab.ui-state-active a { color: #444 ; } -#tabs .ui-tabs-nav li img { position: relative ; top: 2px ; height: 1em ; } +#tabs .ui-tabs-nav li img { position: relative ; top: -1px ; margin-right: 0.4em ; height: 14px ; } #tabs .ui-tabs-panel { background: #f6f6f6 ; } /* nb: these are managed in the code but we define them here for the initial load */ diff --git a/vasl_templates/webapp/static/images/flags/american.png b/vasl_templates/webapp/static/images/flags/american.png index f300f7c..78240d4 100644 Binary files a/vasl_templates/webapp/static/images/flags/american.png and b/vasl_templates/webapp/static/images/flags/american.png differ diff --git a/vasl_templates/webapp/static/images/flags/belgian.png b/vasl_templates/webapp/static/images/flags/belgian.png index c1ac44f..9be72cb 100644 Binary files a/vasl_templates/webapp/static/images/flags/belgian.png and b/vasl_templates/webapp/static/images/flags/belgian.png differ diff --git a/vasl_templates/webapp/static/images/flags/british.png b/vasl_templates/webapp/static/images/flags/british.png index 69e2e74..06d7c52 100644 Binary files a/vasl_templates/webapp/static/images/flags/british.png and b/vasl_templates/webapp/static/images/flags/british.png differ diff --git a/vasl_templates/webapp/static/images/flags/british~anzac.png b/vasl_templates/webapp/static/images/flags/british~anzac.png index 8f65a87..5feef44 100644 Binary files a/vasl_templates/webapp/static/images/flags/british~anzac.png and b/vasl_templates/webapp/static/images/flags/british~anzac.png differ diff --git a/vasl_templates/webapp/static/images/flags/british~australian.png b/vasl_templates/webapp/static/images/flags/british~australian.png index 97ddb4d..3e45c9c 100644 Binary files a/vasl_templates/webapp/static/images/flags/british~australian.png and b/vasl_templates/webapp/static/images/flags/british~australian.png differ diff --git a/vasl_templates/webapp/static/images/flags/british~canadian.png b/vasl_templates/webapp/static/images/flags/british~canadian.png index cf1e44c..5c629b9 100644 Binary files a/vasl_templates/webapp/static/images/flags/british~canadian.png and b/vasl_templates/webapp/static/images/flags/british~canadian.png differ diff --git a/vasl_templates/webapp/static/images/flags/british~newzealand.png b/vasl_templates/webapp/static/images/flags/british~newzealand.png index 69e2e74..aac31ac 100644 Binary files a/vasl_templates/webapp/static/images/flags/british~newzealand.png and b/vasl_templates/webapp/static/images/flags/british~newzealand.png differ diff --git a/vasl_templates/webapp/static/images/flags/bulgarian.png b/vasl_templates/webapp/static/images/flags/bulgarian.png index 44b6d38..0f73cf7 100644 Binary files a/vasl_templates/webapp/static/images/flags/bulgarian.png and b/vasl_templates/webapp/static/images/flags/bulgarian.png differ diff --git a/vasl_templates/webapp/static/images/flags/burmese.png b/vasl_templates/webapp/static/images/flags/burmese.png index 35ff0e1..fc7b56a 100644 Binary files a/vasl_templates/webapp/static/images/flags/burmese.png and b/vasl_templates/webapp/static/images/flags/burmese.png differ diff --git a/vasl_templates/webapp/static/images/flags/chinese.png b/vasl_templates/webapp/static/images/flags/chinese.png index d5121b9..6cc321f 100644 Binary files a/vasl_templates/webapp/static/images/flags/chinese.png and b/vasl_templates/webapp/static/images/flags/chinese.png differ diff --git a/vasl_templates/webapp/static/images/flags/chinese~gmd.png b/vasl_templates/webapp/static/images/flags/chinese~gmd.png index 2d58f30..ad26389 100644 Binary files a/vasl_templates/webapp/static/images/flags/chinese~gmd.png and b/vasl_templates/webapp/static/images/flags/chinese~gmd.png differ diff --git a/vasl_templates/webapp/static/images/flags/croatian.png b/vasl_templates/webapp/static/images/flags/croatian.png index 37e06ce..e8a83b9 100644 Binary files a/vasl_templates/webapp/static/images/flags/croatian.png and b/vasl_templates/webapp/static/images/flags/croatian.png differ diff --git a/vasl_templates/webapp/static/images/flags/danish.png b/vasl_templates/webapp/static/images/flags/danish.png index 13c0e0f..eeed358 100644 Binary files a/vasl_templates/webapp/static/images/flags/danish.png and b/vasl_templates/webapp/static/images/flags/danish.png differ diff --git a/vasl_templates/webapp/static/images/flags/dutch.png b/vasl_templates/webapp/static/images/flags/dutch.png index b0c557f..d91c954 100644 Binary files a/vasl_templates/webapp/static/images/flags/dutch.png and b/vasl_templates/webapp/static/images/flags/dutch.png differ diff --git a/vasl_templates/webapp/static/images/flags/filipino.png b/vasl_templates/webapp/static/images/flags/filipino.png index 7fb9f07..a7554d4 100644 Binary files a/vasl_templates/webapp/static/images/flags/filipino.png and b/vasl_templates/webapp/static/images/flags/filipino.png differ diff --git a/vasl_templates/webapp/static/images/flags/finnish.png b/vasl_templates/webapp/static/images/flags/finnish.png index f9d4aed..e6b82c1 100644 Binary files a/vasl_templates/webapp/static/images/flags/finnish.png and b/vasl_templates/webapp/static/images/flags/finnish.png differ diff --git a/vasl_templates/webapp/static/images/flags/free-french.png b/vasl_templates/webapp/static/images/flags/free-french.png index d953187..b2820ee 100644 Binary files a/vasl_templates/webapp/static/images/flags/free-french.png and b/vasl_templates/webapp/static/images/flags/free-french.png differ diff --git a/vasl_templates/webapp/static/images/flags/french.png b/vasl_templates/webapp/static/images/flags/french.png index 1c6656e..d713f1b 100644 Binary files a/vasl_templates/webapp/static/images/flags/french.png and b/vasl_templates/webapp/static/images/flags/french.png differ diff --git a/vasl_templates/webapp/static/images/flags/german.png b/vasl_templates/webapp/static/images/flags/german.png index 5b88cca..383dfc4 100644 Binary files a/vasl_templates/webapp/static/images/flags/german.png and b/vasl_templates/webapp/static/images/flags/german.png differ diff --git a/vasl_templates/webapp/static/images/flags/greek.png b/vasl_templates/webapp/static/images/flags/greek.png index e55b6ba..5b21fd6 100644 Binary files a/vasl_templates/webapp/static/images/flags/greek.png and b/vasl_templates/webapp/static/images/flags/greek.png differ diff --git a/vasl_templates/webapp/static/images/flags/hungarian.png b/vasl_templates/webapp/static/images/flags/hungarian.png index 29f1aac..39874ee 100644 Binary files a/vasl_templates/webapp/static/images/flags/hungarian.png and b/vasl_templates/webapp/static/images/flags/hungarian.png differ diff --git a/vasl_templates/webapp/static/images/flags/indonesian.png b/vasl_templates/webapp/static/images/flags/indonesian.png index db26f01..a9977e2 100644 Binary files a/vasl_templates/webapp/static/images/flags/indonesian.png and b/vasl_templates/webapp/static/images/flags/indonesian.png differ diff --git a/vasl_templates/webapp/static/images/flags/italian.png b/vasl_templates/webapp/static/images/flags/italian.png index b4b78e5..6f0d01c 100644 Binary files a/vasl_templates/webapp/static/images/flags/italian.png and b/vasl_templates/webapp/static/images/flags/italian.png differ diff --git a/vasl_templates/webapp/static/images/flags/japanese.png b/vasl_templates/webapp/static/images/flags/japanese.png index 4c87043..fff7d97 100644 Binary files a/vasl_templates/webapp/static/images/flags/japanese.png and b/vasl_templates/webapp/static/images/flags/japanese.png differ diff --git a/vasl_templates/webapp/static/images/flags/kfw-cpva.png b/vasl_templates/webapp/static/images/flags/kfw-cpva.png index 28a5a70..3c46816 100644 Binary files a/vasl_templates/webapp/static/images/flags/kfw-cpva.png and b/vasl_templates/webapp/static/images/flags/kfw-cpva.png differ diff --git a/vasl_templates/webapp/static/images/flags/kfw-kpa.png b/vasl_templates/webapp/static/images/flags/kfw-kpa.png index ff16485..166300e 100644 Binary files a/vasl_templates/webapp/static/images/flags/kfw-kpa.png and b/vasl_templates/webapp/static/images/flags/kfw-kpa.png differ diff --git a/vasl_templates/webapp/static/images/flags/kfw-ounc.png b/vasl_templates/webapp/static/images/flags/kfw-ounc.png index 576b4b0..c29f831 100644 Binary files a/vasl_templates/webapp/static/images/flags/kfw-ounc.png and b/vasl_templates/webapp/static/images/flags/kfw-ounc.png differ diff --git a/vasl_templates/webapp/static/images/flags/kfw-rok.png b/vasl_templates/webapp/static/images/flags/kfw-rok.png index d64f3cf..4064e12 100644 Binary files a/vasl_templates/webapp/static/images/flags/kfw-rok.png and b/vasl_templates/webapp/static/images/flags/kfw-rok.png differ diff --git a/vasl_templates/webapp/static/images/flags/polish.png b/vasl_templates/webapp/static/images/flags/polish.png index e394ee6..b6c7276 100644 Binary files a/vasl_templates/webapp/static/images/flags/polish.png and b/vasl_templates/webapp/static/images/flags/polish.png differ diff --git a/vasl_templates/webapp/static/images/flags/romanian.png b/vasl_templates/webapp/static/images/flags/romanian.png index e4b2ffa..571f558 100644 Binary files a/vasl_templates/webapp/static/images/flags/romanian.png and b/vasl_templates/webapp/static/images/flags/romanian.png differ diff --git a/vasl_templates/webapp/static/images/flags/russian.png b/vasl_templates/webapp/static/images/flags/russian.png index 4e650cf..6cc321f 100644 Binary files a/vasl_templates/webapp/static/images/flags/russian.png and b/vasl_templates/webapp/static/images/flags/russian.png differ diff --git a/vasl_templates/webapp/static/images/flags/slovakian.png b/vasl_templates/webapp/static/images/flags/slovakian.png index a186fcb..85cccb7 100644 Binary files a/vasl_templates/webapp/static/images/flags/slovakian.png and b/vasl_templates/webapp/static/images/flags/slovakian.png differ diff --git a/vasl_templates/webapp/static/images/flags/swedish.png b/vasl_templates/webapp/static/images/flags/swedish.png index c030b6b..7627c71 100644 Binary files a/vasl_templates/webapp/static/images/flags/swedish.png and b/vasl_templates/webapp/static/images/flags/swedish.png differ diff --git a/vasl_templates/webapp/static/images/flags/thai.png b/vasl_templates/webapp/static/images/flags/thai.png index 4b1bbad..fde3edc 100644 Binary files a/vasl_templates/webapp/static/images/flags/thai.png and b/vasl_templates/webapp/static/images/flags/thai.png differ diff --git a/vasl_templates/webapp/static/images/flags/yugoslavian.png b/vasl_templates/webapp/static/images/flags/yugoslavian.png index a6f2852..1df5a36 100644 Binary files a/vasl_templates/webapp/static/images/flags/yugoslavian.png and b/vasl_templates/webapp/static/images/flags/yugoslavian.png differ diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index a6bc938..d46639c 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -340,11 +340,13 @@ $(document).ready( function () { if ( ++nFlagsChecked === nats.length ) { // we've checked all the flags - now we can build the player droplists init_player_droplists() ; + update_ob_tab_header( 1 ) ; + update_ob_tab_header( 2 ) ; update_page_load_status( "flag-urls" ) ; } } nats.forEach( function( nat ) { - var url = make_player_flag_url( nat, false ) ; + var url = make_player_flag_url( nat, false ) + "?no-spacer=1" ; $.ajax( url, { success: function() { gHasPlayerFlag[nat] = true ; onFlagChecked() ; }, error: function() { onFlagChecked() ; }, @@ -522,8 +524,8 @@ function init_player_droplists() return opt.text ; var url = gHasPlayerFlag[opt.id] ? make_player_flag_url( opt.id, false ) : "" ; return $( "
" + - "
" + - "" + + "
" + + "" + "
" + " " + opt.text + "
" ) ; @@ -682,8 +684,8 @@ function update_page_load_status( id ) if ( gPageLoadStatus.length === 0 ) { // yup - update the UI apply_user_settings() ; - $( "a[href='#tabs-extras'] div" ).html( - " Extras" + $( "a[href='#tabs-extras']" ).html( + "Extras" ) ; $("#tabs").tabs({ disabled: [] }) ; $("#loader").fadeOut( 500 ) ; @@ -781,7 +783,7 @@ function install_template_pack( data ) } // update the OB tab headers - // NOTE: We don't do this while the page is initially loading, it will be done when the default scenario loaded. + // NOTE: We don't do this while the page is initially loading, since we need the player flags. if ( gPageLoadStatus.indexOf( "flag-urls" ) === -1 ) { update_ob_tab_header( 1 ) ; update_ob_tab_header( 2 ) ; @@ -910,7 +912,7 @@ function update_ob_tab_header( player_no ) var $elem = $( "#tabs .ui-tabs-nav a[href='#tabs-ob" + player_no + "']" ) ; var buf = [] ; if ( gHasPlayerFlag[ player_nat ] ) - buf.push( " " ) ; + buf.push( "" ) ; buf.push( "" + escapeHTML(display_name) + " OB" ) ; $elem.html( buf.join("") ) ; diff --git a/vasl_templates/webapp/static/utils.js b/vasl_templates/webapp/static/utils.js index cc7c176..a44706f 100644 --- a/vasl_templates/webapp/static/utils.js +++ b/vasl_templates/webapp/static/utils.js @@ -431,7 +431,7 @@ function add_flag_to_dialog_titlebar( $dlg, player_no ) { // add a flag to the dialog's titlebar var player_nat = get_player_nat( player_no ) ; - if ( ! player_nat ) + if ( ! player_nat || ! gHasPlayerFlag[ player_nat ] ) return ; var $titlebar = $dlg.dialog( "instance" ).uiDialogTitlebar ; var url = make_player_flag_url( player_nat, false ) ; diff --git a/vasl_templates/webapp/templates/tabs.html b/vasl_templates/webapp/templates/tabs.html index 238f437..d831949 100644 --- a/vasl_templates/webapp/templates/tabs.html +++ b/vasl_templates/webapp/templates/tabs.html @@ -6,11 +6,11 @@ {%include "tabs-scenario.html"%}