Changed the default ELR and SAN.

master
Pacman Ghost 4 years ago
parent baeeecac97
commit 1aad4da2a8
  1. 4
      vasl_templates/webapp/data/default-scenario.json
  2. 5
      vasl_templates/webapp/static/main.js
  3. 2
      vasl_templates/webapp/static/snippets.js
  4. 7
      vasl_templates/webapp/tests/fixtures/data/default-scenario.json
  5. 4
      vasl_templates/webapp/tests/test_scenario_persistence.py

@ -3,11 +3,7 @@
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "german",
"PLAYER_1_ELR": "5",
"PLAYER_1_SAN": "2",
"PLAYER_2": "russian",
"PLAYER_2_ELR": "5",
"PLAYER_2_SAN": "2",
"VICTORY_CONDITIONS_WIDTH": "300px",
"SSR_WIDTH": "300px",

@ -231,15 +231,16 @@ $(document).ready( function () {
} ) ;
// load the ELR's and SAN's
var buf = [] ;
buf = [ "<option value=''>-</option>" ] ; // nb: to help the user to remember to set this
for ( var i=0 ; i <= 5 ; ++i ) // nb: A19.1: ELR is 0-5
buf.push( "<option value='" + i + "'>" + i + "</option>" ) ;
buf = buf.join( "" ) ;
var player_no, $sel ;
for ( player_no=1 ; player_no <= 2 ; ++player_no ) {
init_select2( $( "select[name='PLAYER_" + player_no + "_ELR']" ),
$sel = init_select2( $( "select[name='PLAYER_" + player_no + "_ELR']" ),
"3em", false, null
).html( buf ) ;
$sel.data( "select2" ).$results.css( "max-height", "15em" ) ;
}
buf = [ "<option value=''>-</option>" ] ; // nb: allow scenarios that have no SAN
for ( i=2 ; i <= 7 ; ++i ) // nb: A14.1: SAN is 2-7

@ -1944,7 +1944,7 @@ function reset_scenario()
var player_no ;
for ( player_no=1 ; player_no <= 2 ; ++player_no ) {
on_player_change( player_no ) ;
$("select[name='PLAYER_" + player_no + "_ELR']").val( 0 ).trigger( "change" ) ;
$("select[name='PLAYER_" + player_no + "_ELR']").val( "" ).trigger( "change" ) ;
$("select[name='PLAYER_" + player_no + "_SAN']").val( "" ).trigger( "change" ) ;
}

@ -3,11 +3,6 @@
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "german",
"PLAYER_1_ELR": "5",
"PLAYER_1_SAN": "2",
"PLAYER_2": "russian",
"PLAYER_2_ELR": "5",
"PLAYER_2_SAN": "2"
"PLAYER_2": "russian"
}

@ -163,9 +163,9 @@ def test_scenario_persistence( webapp, webdriver ): #pylint: disable=too-many-st
data2 = { k: v for k,v in data.items() if not k.startswith("_") and v }
assert data2 == {
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "german", "PLAYER_1_ELR": "5", "PLAYER_1_SAN": "2",
"PLAYER_1": "german",
"OB_VEHICLES_MA_NOTES_WIDTH_1": "300px", "OB_ORDNANCE_MA_NOTES_WIDTH_1": "300px",
"PLAYER_2": "russian", "PLAYER_2_ELR": "5", "PLAYER_2_SAN": "2",
"PLAYER_2": "russian",
"OB_VEHICLES_MA_NOTES_WIDTH_2": "300px", "OB_ORDNANCE_MA_NOTES_WIDTH_2": "300px",
}

Loading…
Cancel
Save