Added an icon to the snippet buttons.

master
Pacman Ghost 6 years ago
parent bb3ecb0852
commit c441054702
  1. 10
      vasl_templates/webapp/static/css/main.css
  2. 2
      vasl_templates/webapp/static/css/sortable.css
  3. 13
      vasl_templates/webapp/static/css/tabs-ob.css
  4. 7
      vasl_templates/webapp/static/css/tabs-scenario.css
  5. BIN
      vasl_templates/webapp/static/images/edit-template.png
  6. BIN
      vasl_templates/webapp/static/images/snippet-hot.png
  7. BIN
      vasl_templates/webapp/static/images/snippet.png
  8. 35
      vasl_templates/webapp/static/main.js
  9. 11
      vasl_templates/webapp/static/simple_notes.js
  10. 32
      vasl_templates/webapp/templates/index.html
  11. 8
      vasl_templates/webapp/tests/test_ob.py
  12. 20
      vasl_templates/webapp/tests/test_snippets.py
  13. 2
      vasl_templates/webapp/tests/test_ssr.py
  14. 6
      vasl_templates/webapp/tests/test_template_packs.py
  15. 10
      vasl_templates/webapp/tests/test_vehicles_ordnance.py
  16. 2
      vasl_templates/webapp/tests/utils.py

@ -84,11 +84,15 @@ input[type="text"] { margin-bottom: 0.25em ; }
/* FUDGE! Fix vertical alignment between labels and their input boxes :-/ */
div.label { border: 1px dotted transparent ; }
.snippet-control { margin-top: -1px ; }
.snippet-control input[type="button"] { padding: 2px 5px ; }
.snippet-control button.generate { height: 26px ; padding: 2px 5px ; }
.snippet-control button.generate img { height: 20px ; margin-right: 3px ; vertical-align: middle ; }
.snippet-control .ui-selectmenu-button { padding: 2px 10px ; }
.snippet-control-menu-item { font-size: 75% ; }
.ui-selectmenu-icon.ui-icon { margin-top: -8px; }
.ui-selectmenu-button-closed { height: 26px ; }
.ui-selectmenu-icon.ui-icon { margin-top: -7px; }
button.edit-template { height: 26px ; padding: 2px 5px ; }
button.edit-template img { height: 18px ; vertical-align: middle ; }
.ui-dialog-titlebar { padding: 0.2em 0.5em 0.2em 0.5em !important ; }
.ui-dialog-titlebar-close { margin-top: -10px !important ; }

@ -7,7 +7,7 @@
.sortable li.highlighted { background: #48c8ff ; }
.sortable li:hover { cursor: pointer ; }
.sortable li input[type="button"] { float: right ; }
.sortable li img.snippet { height: 1.25em ; margin: -2px -2px ; padding-left: 1em ; float: right ; }
.sortable-hint { width:100% ; height: calc(100% - 1.5em) ; font-size: 80% ; font-style: italic ; }
.sortable-hint p { margin-bottom: 1em ; }

@ -3,7 +3,7 @@
.panel-ob_setups {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
grid-template-columns: 1fr ; -ms-grid-columns: 1fr ;
}
/* FUDGE! IE hackamathon follows... */
@ -18,7 +18,7 @@
.panel-ob_notes {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
grid-template-columns: 1fr ; -ms-grid-columns: 1fr ;
}
/* FUDGE! IE hackamathon follows... */
@ -27,15 +27,16 @@
.panel-ob_notes .footer { font-size: 75% ; }
.panel-ob_notes .footer .l { float: left ; }
.panel-ob_notes .footer input[type="button"][data-id="ob_note"] { float: right ; }
.panel-ob_notes div.snippet-control { float: right ; margin: 0.25em 0.25em 0 0 ; }
.panel-ob_notes .footer button[data-id="ob_note"] { float: right ; }
.panel-ob_notes div.snippet-control { float: right ; margin-right: 0.25em ; }
.panel-ob_notes button.edit-template { margin-left: 1em ; }
/* -------------------------------------------------------------------- */
.panel-vehicles {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
grid-template-columns: 1fr ; -ms-grid-columns: 1fr ;
}
/* FUDGE! IE hackamathon follows... */
@ -50,7 +51,7 @@
.panel-ordnance {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
grid-template-columns: 1fr ; -ms-grid-columns: 1fr ;
}
/* FUDGE! IE hackamathon follows... */

@ -44,14 +44,13 @@
#panel-players input[data-id="players"] { margin-top: 0.25em ; }
#panel-players .footer { margin-top: 0.25em ; font-size: 75% ; text-align: right ; }
#panel-players .footer input[type='button'] { margin: 0 ; }
/* -------------------------------------------------------------------- */
#panel-vc {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
}
/* FUDGE! IE hackamathon follows (nb: <label> doesn't work, we use <div> for labels instead :-/) */
#panel-vc .footer { -ms-grid-row: 2 ; -ms-grid-column: 1 ; }
@ -64,7 +63,7 @@
#panel-scenario_notes {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
}
/* FUDGE! IE hackamathon follows (nb: <label> doesn't work, we use <div> for labels instead :-/) */
#panel-scenario_notes .content { -ms-grid-row: 1 ; -ms-grid-column: 1 ; }
@ -78,7 +77,7 @@
#panel-ssr {
height: 100% ;
display: grid ; display: -ms-grid ;
grid-template-rows: 1fr 2em ; -ms-grid-rows: 1fr 2em ;
grid-template-rows: 1fr 40px ; -ms-grid-rows: 1fr 40px ;
}
/* FUDGE! IE hackamathon follows (nb: <label> doesn't work, we use <div> for labels instead :-/) */
#panel-ssr .content { -ms-grid-row: 1 ; -ms-grid-column: 1 ; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -89,41 +89,26 @@ $(document).ready( function () {
$("#scenario_notes-sortable").sortable2( "init", {
add: add_scenario_note, edit: edit_scenario_note,
} ) ;
$("#panel-scenario_notes input[type='button'][data-id='scenario_note']").click( function() {
edit_template( "scenario_note" ) ;
} ) ;
// initialize the OB setups
$("#ob_setups-sortable_1").sortable2( "init", {
add: function() { add_ob_setup(1) ; },
edit: edit_ob_setup
} ) ;
$("#panel-ob_setups1 input[type='button'][data-id='ob_setup']").click( function() {
edit_template( "ob_setup" ) ;
} ) ;
$("#ob_setups-sortable_2").sortable2( "init", {
add: function() { add_ob_setup(2) ; },
edit: edit_ob_setup
} ) ;
$("#panel-ob_setups2 input[type='button'][data-id='ob_setup']").click( function() {
edit_template( "ob_setup" ) ;
} ) ;
// initialize the OB notes
$("#ob_notes-sortable_1").sortable2( "init", {
add: function() { add_ob_note(1) ; },
edit: edit_ob_note
} ) ;
$("#panel-ob_notes1 input[type='button'][data-id='ob_note']").click( function() {
edit_template( "ob_note" ) ;
} ) ;
$("#ob_notes-sortable_2").sortable2( "init", {
add: function() { add_ob_note(2) ; },
edit: edit_ob_note
} ) ;
$("#panel-ob_notes2 input[type='button'][data-id='ob_note']").click( function() {
edit_template( "ob_note" ) ;
} ) ;
// initialize the OB vehicles
$("#vehicles-sortable_1").sortable2( "init", {
@ -228,7 +213,7 @@ $(document).ready( function () {
$(window).trigger( "resize" ) ;
// replace all the "generate" buttons with "generate/edit" button/droplist's
$("input[type='button'].generate").each( function() {
$("button.generate").each( function() {
var template_id = $(this).attr( "data-id" ) ;
var template_id2 ;
if ( template_id.substring(0,9) === "ob_setup_" )
@ -242,11 +227,14 @@ $(document).ready( function () {
var buf = [ "<div class='snippet-control' data-id='" + template_id + "'>",
$(this).prop( "outerHTML" ),
"<select data-id='" + template_id2 + "'>",
"<option value='edit' class='edit-template'>Edit</option>",
"<option value='edit' class='edit-template' title='Edit the template that will generate this snippet.'>Edit</option>",
"</select>",
"</div>"
] ;
var $newElem = $( buf.join("") ) ;
$newElem.find( "button" ).prepend(
$( "<img src='" + gImagesBaseUrl + "/snippet.png'>" )
) ;
$newElem.controlgroup() ;
$newElem.children("select").each( function() {
$(this).selectmenu( {
@ -262,14 +250,21 @@ $(document).ready( function () {
} ) ;
// handle requests to generate/edit HTML snippets
$("input[type='button'].generate").click( function() {
$("button.generate").click( function() {
generate_snippet( $(this), null ) ;
} ) ;
} ).attr( "title", "Generate a snippet." ) ;
$("div.snippet-control select").on( "selectmenuselect", function() {
edit_template( $(this).attr("data-id") ) ;
} ) ;
enable_ctrl_enter( $("#edit-template"), "Close" ) ;
// handle requests to edit the templates
$("button.edit-template").click( function() {
edit_template( $(this).data( "id" ) ) ;
} ).html( "<div><img src='" + gImagesBaseUrl + "/edit-template.png'>Edit</div>" )
.attr( "title", "Edit the template." )
.addClass( "ui-button" ) ;
// enable Ctrl-Enter when editing simple notes
enable_ctrl_enter( $("#edit-simple_note"), "OK" ) ;
@ -278,7 +273,7 @@ $(document).ready( function () {
// add some dummy links for the test suite to edit templates
if ( getUrlParam( "edit_template_links" ) ) {
$("input[type='button'].generate").each( function() {
$("button.generate").each( function() {
var template_id = $(this).attr( "data-id" ) ;
if ( template_id.substring(0,9) === "ob_setup_" )
template_id = "ob_setup" ;

@ -109,13 +109,20 @@ function _make_simple_note( note_type, caption )
var buf = [ "<div>" ] ;
if ( ["scenario_notes","ob_setups","ob_notes"].indexOf( note_type ) !== -1 ) {
var note_type0 = note_type.substring( 0, note_type.length-1 ) ;
buf.push( "<input type='button' data-id='" + note_type0 + "' value='Snippet'>" ) ;
buf.push(
"<img src='" + gImagesBaseUrl + "/snippet.png" + "'",
" class='snippet' data-id='" + note_type0 + "' title='Generate a snippet.'>"
) ;
}
buf.push( caption, "</div>" ) ;
var $content = $( buf.join("") ) ;
$content.children( "img" ).hover(
function() { $(this).attr( "src", gImagesBaseUrl + "/snippet-hot.png" ) ; },
function() { $(this).attr( "src", gImagesBaseUrl + "/snippet.png" ) ; }
) ;
// add a handler for the snippet button
$content.children("input[type='button']").click( function() {
$content.children("img.snippet").click( function() {
var data = $(this).parent().parent().data( "sortable2-data" ) ;
var key ;
if ( note_type === "scenario_notes" )

@ -50,7 +50,7 @@
<div class="r">
<label for="SCENARIO_WIDTH">Width:</label>
<input type="text" class="param" name="SCENARIO_WIDTH" size="5">
<input type="button" class="generate" data-id="scenario" value="Snippet">
<button class="generate" data-id="scenario">Snippet</button>
</div>
</div>
</div>
@ -62,7 +62,7 @@
<div class="label" data-labelfor="PLAYER_2">Player 2:</div> <select name="PLAYER_2" class="param"></select>
<select name="PLAYER_2_ELR" class="param"></select>
<select name="PLAYER_2_SAN" class="param"></select>
<div class="footer"> <input type="button" class="generate" data-id="players" value="Snippet"> </div>
<div class="footer"> <button class="generate" data-id="players">Snippet</button> </div>
</div>
</fieldset>
@ -72,7 +72,7 @@
<div class="footer">
<label for="VICTORY_CONDITIONS_WIDTH">Width:</label>
<input type="text" class="param" name="VICTORY_CONDITIONS_WIDTH" size="5">
<input type="button" class="generate" data-id="victory_conditions" value="Snippet">
<button class="generate" data-id="victory_conditions">Snippet</button>
</div>
</div>
</fieldset>
@ -88,7 +88,7 @@
<input type="button" id="scenario_notes-add" value="+">
<img id="scenario_notes-trash" class="sortable-trash">
</div>
<input type="button" data-id="scenario_note" value="EDIT">
<button class="edit-template" data-id="scenario_note"></button>
</div>
</div>
</fieldset>
@ -106,7 +106,7 @@
</div>
<label for="SSR_WIDTH">Width:</label>
<input type="text" class="param" name="SSR_WIDTH" size="5">
<input type="button" class="generate" data-id="ssr" value="Snippet">
<button class="generate" data-id="ssr">Snippet</button>
</div>
</div>
</fieldset>
@ -128,7 +128,7 @@
<input type="button" id="ob_setups-add_1" value="+">
<img id="ob_setups-trash_1" class="sortable-trash">
</div>
<input type="button" data-id="ob_setup" value="EDIT">
<button class="edit-template" data-id="ob_setup"></button>
</div>
</div>
</fieldset>
@ -144,14 +144,14 @@
<input type="button" id="ob_notes-add_1" value="+">
<img id="ob_notes-trash_1" class="sortable-trash">
</div>
<input type="button" data-id="ob_note" value="EDIT">
<input type="button" class="generate" data-id="mol" value="MOL">
<input type="button" class="generate" data-id="mol-p" value="MOL-P">
<input type="button" class="generate" data-id="pf" value="PF">
<input type="button" class="generate" data-id="psk" value="PSK">
<input type="button" class="generate" data-id="atmm" value="ATMM">
<input type="button" class="generate" data-id="baz" value="BAZ">
<input type="button" class="generate" data-id="piat" value="PIAT">
<button class="edit-template" data-id="ob_note"></button>
<button class="generate" data-id="mol">MOL</button>
<button class="generate" data-id="mol-p">MOL-P</button>
<button class="generate" data-id="pf">PF</button>
<button class="generate" data-id="psk">PSK</button>
<button class="generate" data-id="atmm">ATMM</button>
<button class="generate" data-id="baz">BAZ"</button>
<button class="generate" data-id="piat">PIAT</button>
</div>
</div>
</fieldset>
@ -169,7 +169,7 @@
</div>
<label for="VEHICLES_WIDTH_1">Width:</label>
<input type="text" class="param" name="VEHICLES_WIDTH_1" size="5">
<input type="button" class="generate" data-id="vehicles_1" value="Snippet">
<button class="generate" data-id="vehicles_1">Snippet</button>
</div>
</div>
</fieldset>
@ -187,7 +187,7 @@
</div>
<label for="ORDNANCE_WIDTH_1">Width:</label>
<input type="text" class="param" name="ORDNANCE_WIDTH_1" size="5">
<input type="button" class="generate" data-id="ordnance_1" value="Snippet">
<button class="generate" data-id="ordnance_1">Snippet</button>
</div>
</div>
</fieldset>

@ -42,7 +42,7 @@ def _do_test_ob_entries( webapp, webdriver, ob_type ):
# check that snippets are generated correctly
def check_snippet( sortable, entry_no, expected ):
"""Generate the snippet for an OB setup/note."""
elems = find_children( "li input[type='button']", sortable )
elems = find_children( "li img.snippet", sortable )
elems[entry_no].click()
if ob_type == "ob_notes":
expected = re.sub( r" \(col=.*?\)", "", expected )
@ -105,7 +105,7 @@ def test_nationality_specific( webapp, webdriver ):
# initialize
def check_pf_snippets():
"""Check that the PF snippets are generated correctly."""
pf_btn = find_child( "input[type='button'][data-id='pf']" )
pf_btn = find_child( "button[data-id='pf']" )
def do_test( date, expected, warning ): #pylint: disable=missing-docstring
# test snippet generation
set_scenario_date( date )
@ -130,7 +130,7 @@ def test_nationality_specific( webapp, webdriver ):
# initialize
def check_baz_snippets():
"""Check that the BAZ snippets are generated correctly."""
baz_btn = find_child( "input[type='button'][data-id='baz']" )
baz_btn = find_child( "button[data-id='baz']" )
def do_test( date, expected ): #pylint: disable=missing-docstring
# test snippet generation
set_scenario_date( date )
@ -166,7 +166,7 @@ def test_nationality_specific( webapp, webdriver ):
"piat": [ "british", "piat template ; col=[OBCOL:british]/[OBCOL2:british]" ],
}
btn_elems = {
btn: find_child( "input[type='button'][data-id='{}']".format( btn ) )
btn: find_child( "button[data-id='{}']".format( btn ) )
for btn in nationality_specific_buttons
}

@ -16,7 +16,7 @@ def test_scenario_snippets( webapp, webdriver ):
# initialize
webdriver.get( webapp.url_for( "main", store_msgs=1 ) )
select_tab( "scenario" )
btn = find_child( "input.generate[data-id='scenario']" )
btn = find_child( "button.generate[data-id='scenario']" )
# generate a SCENARIO snippet
_test_snippet( btn, {
@ -67,7 +67,7 @@ def test_vc_snippets( webapp, webdriver ):
# initialize
webdriver.get( webapp.url_for( "main", store_msgs=1 ) )
select_tab( "scenario" )
btn = find_child( "input.generate[data-id='victory_conditions']" )
btn = find_child( "button.generate[data-id='victory_conditions']" )
# generate a VC snippet
_test_snippet( btn, {
@ -127,7 +127,7 @@ def test_players_snippets( webapp, webdriver ):
# initialize
webdriver.get( webapp.url_for( "main", store_msgs=1 ) )
select_tab( "scenario" )
btn = find_child( "input.generate[data-id='players']" )
btn = find_child( "button.generate[data-id='players']" )
# generate a PLAYERS snippet
_test_snippet( btn, {
@ -183,7 +183,7 @@ def test_edit_templates( webapp, webdriver ):
edit_template( orig_template_id )
# check that the new template is being used
dismiss_notifications()
elem = find_child( "input.generate[data-id='{}']".format( orig_template_id ) )
elem = find_child( "button.generate[data-id='{}']".format( orig_template_id ) )
elem.click()
_ = get_clipboard() # FUDGE! Work-around a weird intermittent failure on Linux :shrug:
assert get_clipboard() == "EDITED TEMPLATE: {}".format( orig_template_id )
@ -191,20 +191,20 @@ def test_edit_templates( webapp, webdriver ):
# customize the SCENARIO NOTE template
select_tab( "scenario" )
elem = find_child( "input[type='button'][data-id='scenario_note']" )
elem = find_child( "button[data-id='scenario_note']" )
elem.click()
edit_template( "scenario_note" )
# check that the new template is being used
sortable = find_child( "#scenario_notes-sortable" )
add_simple_note( sortable, "scenario note (ignored)", None )
elem = find_child( "li input[type='button']", sortable )
elem = find_child( "li img.snippet", sortable )
elem.click()
assert get_clipboard() == "EDITED TEMPLATE: scenario_note"
# customize the OB SETUP template
select_tab( "ob1" )
elem = find_child( "#tabs-ob1 input[type='button'][data-id='ob_setup']" )
elem = find_child( "#tabs-ob1 button[data-id='ob_setup']" )
elem.click()
edit_template( "ob_setup" )
@ -213,13 +213,13 @@ def test_edit_templates( webapp, webdriver ):
select_tab( "ob{}".format( player_id ) )
sortable = ob_setups[ player_id ]
add_simple_note( sortable, "ob setup (ignored)", None )
elem = find_child( "li input[type='button']", sortable )
elem = find_child( "li img.snippet", sortable )
elem.click()
assert get_clipboard() == "EDITED TEMPLATE: ob_setup"
# customize the OB NOTE template
select_tab( "ob2" )
elem = find_child( "#tabs-ob2 input[type='button'][data-id='ob_note']" )
elem = find_child( "#tabs-ob2 button[data-id='ob_note']" )
elem.click()
edit_template( "ob_note" )
@ -228,7 +228,7 @@ def test_edit_templates( webapp, webdriver ):
select_tab( "ob{}".format( player_id ) )
sortable = ob_notes[ player_id ]
add_simple_note( sortable, "ob note (ignored)", None )
elem = find_child( "li input[type='button']", sortable )
elem = find_child( "li img.snippet", sortable )
elem.click()
assert get_clipboard() == "EDITED TEMPLATE: ob_note"

@ -18,7 +18,7 @@ def test_ssr( webapp, webdriver ):
# initialize
expected = []
generate_snippet_btn = find_child( "input[type='button'][data-id='ssr']" )
generate_snippet_btn = find_child( "button[data-id='ssr']" )
def add_ssr( val ):
"""Add a new SSR."""
expected.append( val )

@ -175,18 +175,18 @@ def _generate_snippet( template_id, orig_template_id ):
# create a scenario note and generate a snippet for it
sortable = find_child( "#scenario_notes-sortable" )
add_simple_note( sortable, "test scenario note", None )
elems = find_children( "li input[type='button']", sortable )
elems = find_children( "li img.snippet", sortable )
elem = elems[0]
elif template_id in ("ob_setup","ob_note"):
# create a OB setup/note and generate a snippet for it
select_tab( "ob1" )
sortable = find_child( "#{}s-sortable_1".format( template_id ) )
add_simple_note( sortable, "test {}".format(template_id), None )
elems = find_children( "#{}s-sortable_1 li input[type='button']".format( template_id ) )
elems = find_children( "#{}s-sortable_1 li img.snippet".format( template_id ) )
elem = elems[0]
else:
# generate a snippet for the specified template
elem = find_child( "input.generate[data-id='{}']".format( orig_template_id ) )
elem = find_child( "button.generate[data-id='{}']".format( orig_template_id ) )
elem.click()
return elem, get_clipboard()

@ -65,7 +65,7 @@ def test_crud( webapp, webdriver ):
# check the snippet
select_tab( "ob{}".format( player_id ) )
dismiss_notifications()
btn = find_child( "input[type='button'][data-id='{}_{}']".format( vo_type, player_id ) )
btn = find_child( "button[data-id='{}_{}']".format( vo_type, player_id ) )
btn.click()
buf = get_clipboard()
names = [
@ -135,7 +135,7 @@ def test_snippets( webapp, webdriver ):
# test a full example
add_vo( vo_type, 1, "a german {}".format(vo_type) )
dismiss_notifications()
btn = find_child( "input[type='button'][data-id='{}_1']".format( vo_type ) )
btn = find_child( "button[data-id='{}_1']".format( vo_type ) )
btn.click()
expected = [
'[German] ; width=',
@ -152,7 +152,7 @@ def test_snippets( webapp, webdriver ):
# test a partial example
add_vo( vo_type, 1, "another german {}".format(vo_type) )
dismiss_notifications()
btn = find_child( "input[type='button'][data-id='{}_1']".format( vo_type ) )
btn = find_child( "button[data-id='{}_1']".format( vo_type ) )
btn.click()
expected = [
'[German] ; width=',
@ -168,7 +168,7 @@ def test_snippets( webapp, webdriver ):
# test a minimal example
add_vo( vo_type, 1, "name only" )
dismiss_notifications()
btn = find_child( "input[type='button'][data-id='{}_1']".format( vo_type ) )
btn = find_child( "button[data-id='{}_1']".format( vo_type ) )
btn.click()
assert get_clipboard() == \
'''[German] ; width=
@ -190,7 +190,7 @@ def test_variable_capabilities( webapp, webdriver ):
add_vo( "vehicles", 2, "Churchill III(b)" )
# change the scenario date and check the generated snippet
vehicles2 = find_child( "input.generate[data-id='vehicles_2']" )
vehicles2 = find_child( "button.generate[data-id='vehicles_2']" )
def do_test( month, year, expected ):
"""Set the date and check the vehicle snippet."""
dismiss_notifications()

@ -205,7 +205,7 @@ def get_sortable_entry_count( sortable ):
def generate_sortable_entry_snippet( sortable, entry_no ):
"""Generate the snippet for a sortable entry."""
elems = find_children( "li input[type='button']", sortable )
elems = find_children( "li img.snippet", sortable )
elems[entry_no].click()
return get_clipboard()

Loading…
Cancel
Save