Added a SCENARIO_ID field.

master
Pacman Ghost 6 years ago
parent 7211c721bd
commit 7860c0591a
  1. 9
      vasl_templates/webapp/data/default-template-pack/scenario.j2
  2. 1
      vasl_templates/webapp/static/css/tabs-scenario.css
  3. 1
      vasl_templates/webapp/templates/index.html
  4. 2
      vasl_templates/webapp/tests/fixtures/data/default-template-pack/scenario.j2
  5. 3
      vasl_templates/webapp/tests/test_scenario_persistence.py

@ -10,10 +10,11 @@
border-bottom: 1px solid #c0c0c0 ;
padding: 5px 10px 5px 10px ;
">
<span style="font-size:150%;font-weight:bold;">
{%if SCENARIO_NAME%} {{SCENARIO_NAME}} {%else%} Untitled scenario {%endif%}
</span>
{%if SCENARIO_LOCATION%} ({{SCENARIO_LOCATION}}) {%endif%}
<div style="font-size:115%;">
<b> {%if SCENARIO_NAME%} {{SCENARIO_NAME}} {%else%} Untitled scenario {%endif%} </b>
{%if SCENARIO_ID%} <small><i> ({{SCENARIO_ID}}) </i></small> {%endif%}
</div>
{%if SCENARIO_LOCATION%} {{SCENARIO_LOCATION}} {%endif%}
{%if SCENARIO_DATE%}
<small><i>({{SCENARIO_MONTH_NAME}} {{SCENARIO_DAY_OF_MONTH_POSTFIX}}, {{SCENARIO_YEAR}})</i></small>
{%endif%}

@ -4,6 +4,7 @@
#panel-scenario .row { display: flex ; align-items: center ; }
#panel-scenario input { flex-grow: 1 ; }
#panel-scenario input[name='SCENARIO_ID'] { margin-left: 0.25em ; width: 4em ; flex-grow: 0 ; }
#panel-scenario input[name='SCENARIO_DATE'] { width: 6em ; flex-grow: 0 ; }
#panel-scenario label { font-weight: bold ; width: 5em ; }

@ -45,6 +45,7 @@
<div class='row'>
<label for="SCENARIO_NAME">Name:</label>
<input name="SCENARIO_NAME" type="text" class="param">
<input name="SCENARIO_ID" type="text" class="param" title="Scenario ID">
</div>
<div class='row'>
<label for="SCENARIO_LOCATION">Location:</label>

@ -1,4 +1,4 @@
name = [{{SCENARIO_NAME}}]
name = [{{SCENARIO_NAME}}]{%if SCENARIO_ID%} ({{SCENARIO_ID}}){%endif%}
loc = [{{SCENARIO_LOCATION}}]
date = [{{SCENARIO_DATE}}]{%if SCENARIO_DATE%} aka "{{SCENARIO_DAY_OF_MONTH}} {{SCENARIO_MONTH_NAME}}, {{SCENARIO_YEAR}}"{%endif%}
{%if SCENARIO_WIDTH%}width = [{{SCENARIO_WIDTH}}]{%endif%}

@ -12,7 +12,7 @@ from vasl_templates.webapp.tests.utils import \
# this table lists all parameters stored in a scenario
ALL_SCENARIO_PARAMS = {
"scenario": [
"SCENARIO_NAME", "SCENARIO_LOCATION", "SCENARIO_DATE", "SCENARIO_WIDTH",
"SCENARIO_NAME", "SCENARIO_ID", "SCENARIO_LOCATION", "SCENARIO_DATE", "SCENARIO_WIDTH",
"PLAYER_1", "PLAYER_1_ELR", "PLAYER_1_SAN",
"PLAYER_2", "PLAYER_2_ELR", "PLAYER_2_SAN",
"VICTORY_CONDITIONS", "VICTORY_CONDITIONS_WIDTH",
@ -51,6 +51,7 @@ def test_scenario_persistence( webapp, webdriver ): #pylint: disable=too-many-st
SCENARIO_PARAMS = {
"scenario": {
"SCENARIO_NAME": "my test scenario",
"SCENARIO_ID": "xyz123",
"SCENARIO_LOCATION": "right here",
"SCENARIO_DATE": "12/31/1945",
"SCENARIO_WIDTH": "101",

Loading…
Cancel
Save