Added templates for Finnish, Hungarian, Romanian PF's.

master
Pacman Ghost 4 years ago
parent 2981843529
commit b2a0cb94e5
  1. 28
      vasl_templates/webapp/data/default-template-pack/extras/count-remaining.j2
  2. 24
      vasl_templates/webapp/data/default-template-pack/national-capabilities.json
  3. 54
      vasl_templates/webapp/data/default-template-pack/pf-finnish.j2
  4. 58
      vasl_templates/webapp/data/default-template-pack/pf-hungarian.j2
  5. 62
      vasl_templates/webapp/data/default-template-pack/pf-romanian.j2
  6. 3
      vasl_templates/webapp/static/main.js
  7. 24
      vasl_templates/webapp/static/snippets.js
  8. 4
      vasl_templates/webapp/static/vassal.js
  9. 3
      vasl_templates/webapp/templates/tabs-ob1.html
  10. 6
      vasl_templates/webapp/tests/fixtures/data/default-template-pack/nationalities.json
  11. 1
      vasl_templates/webapp/tests/fixtures/data/default-template-pack/pf-finnish.j2
  12. 1
      vasl_templates/webapp/tests/fixtures/data/default-template-pack/pf-hungarian.j2
  13. 1
      vasl_templates/webapp/tests/fixtures/data/default-template-pack/pf-romanian.j2
  14. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1940.txt
  15. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1941.txt
  16. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1942.txt
  17. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1943.txt
  18. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1944.txt
  19. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/bulgarian/1945.txt
  20. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1940.txt
  21. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1941.txt
  22. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1942.txt
  23. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1943.txt
  24. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1944.txt
  25. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/croatian/1945.txt
  26. 1
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1940.txt
  27. 1
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1941.txt
  28. 1
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1942.txt
  29. 1
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1943.txt
  30. 1
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1944.txt
  31. 5
      vasl_templates/webapp/tests/fixtures/nat-caps/finnish/1945.txt
  32. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1940.txt
  33. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1941.txt
  34. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1942.txt
  35. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1943.txt
  36. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1944.txt
  37. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/hungarian/1945.txt
  38. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1940.txt
  39. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1941.txt
  40. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1942.txt
  41. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1943.txt
  42. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1944.txt
  43. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/romanian/1945.txt
  44. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1940.txt
  45. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1941.txt
  46. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1942.txt
  47. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1943.txt
  48. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1944.txt
  49. 3
      vasl_templates/webapp/tests/fixtures/nat-caps/slovakian/1945.txt
  50. 1
      vasl_templates/webapp/tests/fixtures/template-packs/full/pf-finnish.j2
  51. 1
      vasl_templates/webapp/tests/fixtures/template-packs/full/pf-hungarian.j2
  52. 1
      vasl_templates/webapp/tests/fixtures/template-packs/full/pf-romanian.j2
  53. 1
      vasl_templates/webapp/tests/fixtures/template-packs/new-default/pf-finnish.j2
  54. 1
      vasl_templates/webapp/tests/fixtures/template-packs/new-default/pf-hungarian.j2
  55. 1
      vasl_templates/webapp/tests/fixtures/template-packs/new-default/pf-romanian.j2
  56. 82
      vasl_templates/webapp/tests/test_extras_templates.py
  57. 4
      vasl_templates/webapp/tests/test_ob.py
  58. 3
      vasl_templates/webapp/tests/utils.py

@ -8,12 +8,20 @@
<td>
<h3>Panzerfaust</h3>
<table class="pf">
<tr> <td class="key"> before '44
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR < 1944%} {{HILITE_STYLE}} {%endif%} > #squads
<tr> <td class="key"> '44
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR == 1944%} {{HILITE_STYLE}} {%endif%}> #squads &times 1&half; (FRD)
<tr> <td class="key"> '45
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR == 1945%} {{HILITE_STYLE}} {%endif%}> #squads &times 2
<tr> <td class="key"> German (-'44)
<td class="val" {%if (PLAYER_1 == "german" or PLAYER_2 == "german") and SCENARIO_YEAR and SCENARIO_YEAR < 1944%} {{HILITE_STYLE}} {%endif%} > #squads
<tr> <td class="key"> German ('44)
<td class="val" {%if (PLAYER_1 == "german" or PLAYER_2 == "german") and SCENARIO_YEAR == 1944%} {{HILITE_STYLE}} {%endif%}> 1&half; &times; #squads (FRD)
<tr> <td class="key"> German ('45)
<td class="val" {%if (PLAYER_1 == "german" or PLAYER_2 == "german") and SCENARIO_YEAR == 1945%} {{HILITE_STYLE}} {%endif%}> 2 &times; #squads
<tr> <td class="key"> Finnish (7/44+)
<td class="val" {%if (PLAYER_1 == "finnish" or PLAYER_2 == "finnish") and (SCENARIO_YEAR >= 1945 or (SCENARIO_YEAR == 1944 and SCENARIO_MONTH >= 7))%} {{HILITE_STYLE}} {%endif%}> 1&half; &times; # Elite/1<sup>st</sup> Line MMC squads (FRD)
<tr> <td class="key"> Hungarian (6/44+)
<td class="val" {%if (PLAYER_1 == "hungarian" or PLAYER_2 == "hungarian") and (SCENARIO_YEAR >= 1945 or (SCENARIO_YEAR == 1944 and SCENARIO_MONTH >= 6))%} {{HILITE_STYLE}} {%endif%}> #squads
<tr> <td class="key"> Romanian (3-12/44)
<td class="val" {%if (PLAYER_1 == "romanian" or PLAYER_2 == "romanian") and SCENARIO_YEAR == 1944 and SCENARIO_MONTH >= 3%} {{HILITE_STYLE}} {%endif%}> 1&half; &times; #squads
<tr> <td class="key"> Romanian ('45)
<td class="val" {%if (PLAYER_1 == "romanian" or PLAYER_2 == "romanian") and SCENARIO_YEAR == 1945%} {{HILITE_STYLE}} {%endif%}> #squads
</table>
<em> Squads or squad-equivalents. </em>
@ -21,13 +29,13 @@
<h3>Tank-Hunter Heroes</h3>
<table class="thh">
<tr> <td class="key"> before '43
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR < 1943%} {{HILITE_STYLE}} {%endif%}> 10% of #squads (FRU) <br> <small><em>(20% vs. Russians)</em></small>
<td class="val" {%if (PLAYER_1 == "japanese" or PLAYER_2 == "japanese") and SCENARIO_YEAR and SCENARIO_YEAR < 1943%} {{HILITE_STYLE}} {%endif%}> 10% of #squads (FRU) <br> <small><em>(20% vs. Russians)</em></small>
<tr> <td class="key"> '43
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR == 1943%} {{HILITE_STYLE}} {%endif%}> 20% of #squads (FRU)
<td class="val" {%if (PLAYER_1 == "japanese" or PLAYER_2 == "japanese") and SCENARIO_YEAR == 1943%} {{HILITE_STYLE}} {%endif%}> 20% of #squads (FRU)
<tr> <td class="key"> '44
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR == 1944%} {{HILITE_STYLE}} {%endif%}> 33% of #squads (FRU)
<td class="val" {%if (PLAYER_1 == "japanese" or PLAYER_2 == "japanese") and SCENARIO_YEAR == 1944%} {{HILITE_STYLE}} {%endif%}> 33% of #squads (FRU)
<tr> <td class="key"> '45
<td class="val" {%if SCENARIO_YEAR and SCENARIO_YEAR == 1945%} {{HILITE_STYLE}} {%endif%}> 50% of #squads (FRU)
<td class="val" {%if (PLAYER_1 == "japanese" or PLAYER_2 == "japanese") and SCENARIO_YEAR == 1945%} {{HILITE_STYLE}} {%endif%}> 50% of #squads (FRU)
</table>
<em> Squads only, not squad-equivalents. </em>
</table> -->

@ -6,11 +6,11 @@
"hob_drm": "0 DRM",
"grenades": "Smoke",
"notes": [
"{? 10/1943- | Inherent PF | No Inherent PF | Inherent PF (10/43+) ?}",
"{? 01/1944- | Inherent ATMM | No Inherent ATMM | Inherent ATMM (44+) ?}",
"{? 10/1943- | Inherent PF | No Inherent PF | Inherent PF<sup>10/43+</sup> ?}",
"{? 01/1944- | Inherent ATMM | No Inherent ATMM | Inherent ATMM<sup>44+</sup> ?}",
"SS: Disrupt &amp; RtPh Surrender NA vs Russians",
"Massacre OK",
"{? 01/1944- | Squad Assault Fire | No Squad Assault Fire | Squad Assault Fire (44+) ?}"
"{? 01/1944- | Squad Assault Fire | No Squad Assault Fire | Squad Assault Fire<sup>44+</sup> ?}"
]
},
@ -23,14 +23,14 @@
"Massacre OK",
"Deploy NA",
"Entrench -1 DRM",
"{? 11/1942- | Commissars NA | Commissars | Commissars (pre-11/42) ?}",
"{? -10/1942 | Commissars | Commissars NA | Commissars<sup>-10/42</sup> ?}",
"Human Wave",
"{? 01/1942- | Riders OK | Riders NA | Riders (42+) ?}"
"{? 01/1942- | Riders OK | Riders NA | Riders<sup>42+</sup> ?}"
]
},
"american": {
"th_color": "{? 01/1944- | Black | Red | Black (44+) ?}",
"th_color": "{? 01/1944- | Black | Red | Black<sup>44+</sup> ?}",
"oba": [ "10B", "3R", "Plentiful Ammo included" ],
"oba_access": "&le; 2",
"hob_drm": "0 DRM",
@ -63,7 +63,7 @@
"th_color": "Black",
"oba": [ "8B", "2R" ], "oba_access": "&le; 2",
"hob_drm": "-1 DRM",
"grenades": "{? 01/1944- | SMOKE | Smoke | SMOKE (44+) ?}",
"grenades": "{? 01/1944- | SMOKE | Smoke | SMOKE<sup>44+</sup> ?}",
"notes": [
"Elite &amp; 1st Line: Cowering NA",
"ANZAC: Stealthy (unless Green)",
@ -104,7 +104,7 @@
"Deploy (1TC) &amp; Recombine without Leader",
"Self-Rally OK [EXC: Conscript]",
"Cowering NA [EXC: Conscript]",
"Elite &amp; 1st Line: <ul> <li> Always Stealthy <li> Use FT/DC as Elite {? 07/1944- | <li> Inherent PF: <ul> <li> Range = 1 <li> PF Check &le; 2 <li> Max. shots = 1&frac12; &times; # Elite/1st Line squad-equivalents (FRD) </ul> | | <li> Inherent PF (7/44+) ?} </ul>",
"Elite &amp; 1st Line: <ul> <li> Always Stealthy <li> Use FT/DC as Elite <li> {? 07/1944- | Inherent PF | No Inherent PF | Inherent PF<sup>7/44+</sup> ?} </ul>",
"Ski-trained (don Skis = one MF)",
"Leader Creation NA",
"Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]"
@ -119,8 +119,8 @@
"notes": [
"Escape NA",
"1st Line &amp; Conscript: <ul> <li> 1 PAATC <li> Surrender on HoB Final DR &ge; 10 </ul>",
"Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+): <ul> <li> Range = {? 06/1944- | 2 | 1 | 1 (pre-6/44), 2 thereafter ?} </ul>",
"{? 07/1943- | Inherent ATMM in Romanian non-Crew Elite &amp; 1st Line MMC (-2 CC DRM) | No Inherent ATMM | Inherent ATMM (7/43+) ?}"
"{? 03/1944- | Inherent PF in non-Crew MMC (Romanian<sup>3/44+</sup>; Hungarian<sup>6/44+</sup>) | No Inherent PF | Inherent PF (Romanian<sup>3/44+</sup>; Hungarian<sup>6/44+</sup>) ?}",
"{? 07/1943- | Inherent ATMM in Romanian non-Crew Elite &amp; 1st Line MMC (-2 CC DRM) | No Inherent ATMM | Inherent ATMM<sup>(7/43+)</sup> ?}"
]
},
@ -212,7 +212,7 @@
"grenades": "SMOKE",
"notes": [
"2nd Line MMC: ELR Replacement &rarr; Disrupt",
"{? 01/1952- | Canadian squads have Assault Fire | | Canadian squads have Assault Fire (1/52+) ?}",
"{? 01/1952- | Canadian squads have Assault Fire | | Canadian squads have Assault Fire<sup>1/52+</sup> ?}",
"Royal Marines: <ul> <li> Commandos <li> No Non-Qualified Use penalty for RCL <li> No Captured Use penalty for Communist SW <li> Self-Deploy (1TC) &amp; Self-Recombine OK </ul>"
]
},
@ -245,7 +245,7 @@
"kfw-cpva": {
"th_color": "Red",
"oba": [
"{? 04/1951- | 7B | | 7B (4/51+) ?}",
"{? 04/1951- | 7B | | 7B<sup>4/51+</sup> ?}",
"{! 04/1951-09/1952 = 3R | 10/1952- = 2R | ??? !}"
],
"oba_access": "&le; 1",

@ -0,0 +1,54 @@
<html> <!-- vasl-templates:id {{SNIPPET_ID}} -->
<head>
<meta charset="utf-8">
<style> {{CSS:common}} </style>
</head>
<table>
<tr>
<td colspan="3" style="
background: {{OB_COLOR}} ;
border-bottom: 1px solid {{OB_COLOR_2}} ;
padding: 2px 5px ;
font-size: 105% ; font-weight: bold ;
">
{{INCLUDE:player_flag}}Panzerfaust
<tr>
<td valign="top" rowspan="2" style="padding:2px 5px;">
Elite &amp; 1<sup>st</sup> Line MMC only <br>
PF check: dr &le; 2 (&#9651;)
<table style="margin-left:10px;">
<tr>
<td style="width:25px;"> +1 <td> HS/crew
<tr>
<td> +2 <td> SMC
<tr>
<td> +1 <td> CX
<tr>
<td> +1 <td> non-AFV target
</table>
original 6 = pinned
<td valign="top" style="padding:0 5px;">
<table>
<tr>
<td> <b>Range</b> <td> <b>TH#</b>
<tr>
<td class="c"> 0 <td class="c"> 10
<tr>
<td class="c"> 1 <td class="c"> 8
</table>
<tr>
<td style="padding:0 5px;text-align:right;">
<b>TK#:</b> 31 <br>
16-3
</table>
</html>

@ -0,0 +1,58 @@
<html> <!-- vasl-templates:id {{SNIPPET_ID}} -->
<head>
<meta charset="utf-8">
<style> {{CSS:common}} </style>
</head>
<table>
<tr>
<td colspan="3" style="
background: {{OB_COLOR}} ;
border-bottom: 1px solid {{OB_COLOR_2}} ;
padding: 2px 5px ;
font-size: 105% ; font-weight: bold ;
">
{{INCLUDE:player_flag}}Panzerfaust
<tr>
<td valign="top" rowspan="2" style="padding:2px 5px;">
Non-Crew MMC only <br>
PF check: dr &le; 2 (&#9651;)
<table style="margin-left:10px;">
<tr>
<td style="width:25px;"> +1 <td> HS/crew
<tr>
<td> +2 <td> SMC
<tr>
<td> +1 <td> CX
<tr>
<td> +1 <td> non-AFV target
<tr>
<td> +1 <td> Conscript
</table>
original 6 = pinned
<td valign="top" style="padding:0 5px;">
<table>
<tr>
<td> <b>Range</b> <td> <b>TH#</b>
<tr>
<td class="c"> 0 <td class="c"> 10
<tr>
<td class="c"> 1 <td class="c"> 8
<tr>
<td class="c"> 2 <td class="c"> 6
</table>
<tr>
<td style="padding:0 5px;text-align:right;">
<b>TK#:</b> 31 <br>
16-3
</table>
</html>

@ -0,0 +1,62 @@
<html> <!-- vasl-templates:id {{SNIPPET_ID}} -->
<head>
<meta charset="utf-8">
<style> {{CSS:common}} </style>
</head>
<table>
<tr>
<td colspan="3" style="
background: {{OB_COLOR}} ;
border-bottom: 1px solid {{OB_COLOR_2}} ;
padding: 2px 5px ;
font-size: 105% ; font-weight: bold ;
">
{{INCLUDE:player_flag}}Panzerfaust
<tr>
<td valign="top" rowspan="2" style="padding:2px 5px;">
Non-Crew MMC only <br>
PF check: dr &le; {%if SCENARIO_YEAR >= 1945%} 1 {%else%} 2 {%endif%} (&#9651;)
<table style="margin-left:10px;">
<tr>
<td style="width:25px;"> +1 <td> HS/crew
<tr>
<td> +2 <td> SMC
<tr>
<td> +1 <td> CX
<tr>
<td> +1 <td> non-AFV target
<tr>
<td> +1 <td> Conscript
<tr>
<td> +1 <td> -1 vs AFV if Elite
</table>
original 6 = pinned
<td valign="top" style="padding:0 5px;">
<table>
<tr>
<td> <b>Range</b> <td> <b>TH#</b>
<tr>
<td class="c"> 0 <td class="c"> 10
<tr>
<td class="c"> 1 <td class="c"> 8
{%if SCENARIO_YEAR >= 1945 or (SCENARIO_YEAR == 1944 and SCENARIO_MONTH >= 6)%}
<tr>
<td class="c"> 2 <td class="c"> 6
{%endif%}
</table>
<tr>
<td style="padding:0 5px;text-align:right;">
<b>TK#:</b> 31 <br>
16-3
</table>
</html>

@ -13,6 +13,9 @@ gEmSize = null ;
var NATIONALITY_SPECIFIC_BUTTONS = {
"pf": [ "german" ],
"pf-finnish": [ "finnish" ],
"pf-hungarian": [ "hungarian" ],
"pf-romanian": [ "romanian" ],
"atmm": [ "german" ],
"psk": [ "german" ],
"mol": [ "russian" ],

@ -395,6 +395,12 @@ function make_snippet( $btn, params, extra_params, show_date_warnings )
if ( show_date_warnings ) {
if ( template_id === "pf" && ! is_pf_available() )
showWarningMsg( "PF are only available after September 1943." ) ;
if ( template_id === "pf-finnish" && ! is_pf_finnish_available() )
showWarningMsg( "PF are only available from July 1944." ) ;
if ( template_id === "pf-hungarian" && ! is_pf_hungarian_available() )
showWarningMsg( "PF are only available from June 1944." ) ;
if ( template_id === "pf-romanian" && ! is_pf_romanian_available() )
showWarningMsg( "PF are only available from March 1944." ) ;
if ( template_id === "psk" && ! is_psk_available() )
showWarningMsg( "PSK are only available after September 1943." ) ;
if ( template_id === "baz" && ! is_baz_available() )
@ -2159,7 +2165,7 @@ function do_load_template_pack( fname, data )
// --------------------------------------------------------------------
function _is_scenario_after( month, year ) {
function _is_scenario_in_or_after( month, year ) {
// check if the scenario is after the specified month/year
var scenario_date = get_scenario_date() ;
if ( ! scenario_date )
@ -2168,13 +2174,16 @@ function _is_scenario_after( month, year ) {
return true ;
if ( scenario_date.getFullYear() < year )
return false ;
return (scenario_date.getMonth() >= month) ;
return scenario_date.getMonth() >= month-1 ;
}
function is_pf_available() { return _is_scenario_after( 9, 1943 ) ; }
function is_psk_available() { return _is_scenario_after( 9, 1943 ) ; }
function is_baz_available() { return _is_scenario_after( 10, 1942 ) ; }
function is_atmm_available() { return _is_scenario_after( 0, 1944 ) ; }
function is_pf_available() { return _is_scenario_in_or_after( 10, 1943 ) ; }
function is_pf_finnish_available() { return _is_scenario_in_or_after( 7, 1944 ) ; }
function is_pf_hungarian_available() { return _is_scenario_in_or_after( 6, 1944 ) ; }
function is_pf_romanian_available() { return _is_scenario_in_or_after( 3, 1944 ) ; }
function is_psk_available() { return _is_scenario_in_or_after( 9, 1943 ) ; }
function is_baz_available() { return _is_scenario_in_or_after( 11, 1942 ) ; }
function is_atmm_available() { return _is_scenario_in_or_after( 1, 1944 ) ; }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -2195,6 +2204,9 @@ function on_scenario_date_change()
} ) ;
}
update_ui( "pf", is_pf_available() ) ;
update_ui( "pf-finnish", is_pf_finnish_available() ) ;
update_ui( "pf-hungarian", is_pf_hungarian_available() ) ;
update_ui( "pf-romanian", is_pf_romanian_available() ) ;
update_ui( "psk", is_psk_available() ) ;
update_ui( "baz", is_baz_available() ) ;
update_ui( "atmm", is_atmm_available() ) ;

@ -92,7 +92,7 @@ function _generate_snippets()
// figure out which templates we don't want to auto-create labels for
var no_autocreate = {} ;
for ( var template_id in NATIONALITY_SPECIFIC_BUTTONS ) {
if ( ["pf","atmm","thh"].indexOf( template_id ) !== -1 ) {
if ( ["pf","atmm","thh"].indexOf( template_id ) !== -1 || template_id.substring(0,3) === "pf-" ) {
// NOTE: PF, ATMM, THH are always available as an inherent part of a squad's capabilities
// (subject to date restrictions), so we always auto-create these labels, unlike, say MOL or BAZ,
// which are only present by SSR or OB counter).
@ -221,7 +221,7 @@ function _get_raw_content( snippet_id, $btn, params )
return [ "Molotov Cocktail", "MOL check:", "IFT DR original colored dr:" ] ;
if ( snippet_id === "mol-p" )
return [ "MOL Projector", "TH#", "X#", "B#" ] ;
if ( snippet_id === "pf" )
if ( snippet_id === "pf" || snippet_id.substring(0,3) === "pf-" )
return [ "Panzerfaust", "PF check:", "non-AFV target", "TH#" ] ;
if ( snippet_id === "psk" )
return [ "Panzerschrek", "Range", "TH#", "X#", "TK#" ] ;

@ -29,6 +29,9 @@
<span class="spacer"></span>
<span class="small">
<button class="generate" data-id="pf">PF</button>
<button class="generate" data-id="pf-finnish">PF</button>
<button class="generate" data-id="pf-hungarian">PF</button>
<button class="generate" data-id="pf-romanian">PF</button>
<button class="generate" data-id="atmm">ATMM</button>
<button class="generate" data-id="psk">PSK</button>
<button class="generate" data-id="mol">MOL</button>

@ -57,6 +57,12 @@
"type": "axis-minor"
},
"hungarian": {
"display_name": "Hungarian",
"ob_colors": [ "OBCOL:hungarian","OBCOL2:hungarian", "OBCOL-BORDER:hungarian" ],
"type": "axis-minor"
},
"kfw-cpva": {
"display_name": "Communist Chinese",
"ob_colors": [ "OBCOL:kfw-cpva","OBCOL2:kfw-cpva", "OBCOL-BORDER:kfw-cpva" ]

@ -0,0 +1 @@
PF-FINNISH: col=[{{OB_COLOR}}]/[{{OB_COLOR_2}}]

@ -0,0 +1 @@
PF-HUNGARIAN: col=[{{OB_COLOR}}]/[{{OB_COLOR_2}}]

@ -0,0 +1 @@
PF-ROMANIAN: col=[{{OB_COLOR}}]/[{{OB_COLOR_2}}]

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 2
* Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+)
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 2
* Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+)
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -12,6 +12,7 @@ OBA: 6B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* No Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -12,6 +12,7 @@ OBA: 7B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* No Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -12,6 +12,7 @@ OBA: 7B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* No Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -12,6 +12,7 @@ OBA: 8B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* No Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -12,6 +12,7 @@ OBA: 8B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* No Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -12,10 +12,7 @@ OBA: 7B 3R (access: ≤ 1)
* Elite & 1st Line:
* Always Stealthy
* Use FT/DC as Elite
* Inherent PF:
* Range = 1
* PF Check ≤ 2
* Max. shots = 1½ × # Elite/1st Line squad-equivalents (FRD)
* Inherent PF
* Ski-trained (don Skis = one MF)
* Leader Creation NA
* Captured Use penalties NA for Russian MG [EXC: LMG in 1939; .50-cal]

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 2
* Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+)
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 2
* Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+)
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* No Inherent ATMM

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 1
* No Inherent PF
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -9,6 +9,5 @@ OBA: 6B 3R (access: ≤ 1)
* 1st Line & Conscript:
* 1 PAATC
* Surrender on HoB Final DR ≥ 10
* Inherent PF in non-Crew MMC (Romanian 3/44+; Hungarian 6/44+):
* Range = 2
* Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+)
* Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM)

@ -3,7 +3,7 @@
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
from vasl_templates.webapp.tests.utils import init_webapp, select_tab, \
from vasl_templates.webapp.tests.utils import init_webapp, select_tab, set_player, \
set_template_params, get_droplist_vals, select_droplist_val, \
find_child, find_children, wait_for, wait_for_clipboard
from vasl_templates.webapp.tests.test_template_packs import make_zip_from_files, upload_template_pack_zip
@ -183,11 +183,11 @@ def test_count_remaining_hilites( webapp, webdriver ):
reset = lambda ct: ct.set_data_dir( dtype="real" )
)
def do_test( year, expected ): #pylint: disable=missing-docstring
def do_test( month, year, expected ): #pylint: disable=missing-docstring
# set the specified year
set_template_params( {
"SCENARIO_DATE": "01/01/{}".format( year ) if year else ""
"SCENARIO_DATE": "{}/01/{}".format( month, year ) if year else ""
} )
# select the "count remaining" template and check what's been highlighted
@ -205,36 +205,80 @@ def test_count_remaining_hilites( webapp, webdriver ):
assert cells == expected[count_type]
# do the tests
do_test( None, {
"pf": [ False, False, False ],
set_player( 1, "german" )
set_player( 2, "japanese" )
do_test( None, None, {
"pf": [ False, False, False, False, False, False, False ],
"thh": [ False, False, False, False ]
} )
do_test( 1940, {
"pf": [ True, False, False ],
do_test( 1, 1940, {
"pf": [ True, False, False, False, False, False, False ],
"thh": [ True, False, False, False ]
} )
do_test( 1941, {
"pf": [ True, False, False ],
do_test( 1, 1941, {
"pf": [ True, False, False, False, False, False, False ],
"thh": [ True, False, False, False ]
} )
do_test( 1942, {
"pf": [ True, False, False ],
do_test( 1, 1942, {
"pf": [ True, False, False, False, False, False, False ],
"thh": [ True, False, False, False ]
} )
do_test( 1943, {
"pf": [ True, False, False ],
do_test( 1, 1943, {
"pf": [ True, False, False, False, False, False, False ],
"thh": [ False, True, False, False ]
} )
do_test( 1944, {
"pf": [ False, True, False ],
do_test( 1, 1944, {
"pf": [ False, True, False, False, False, False, False ],
"thh": [ False, False, True, False ]
} )
do_test( 1945, {
"pf": [ False, False, True ],
do_test( 1, 1945, {
"pf": [ False, False, True, False, False, False, False ],
"thh": [ False, False, False, True ]
} )
do_test( 1946, {
"pf": [ False, False, False ],
do_test( 1, 1946, {
"pf": [ False, False, False, False, False, False, False ],
"thh": [ False, False, False, False ]
} )
# do the tests
set_player( 1, "finnish" )
set_player( 2, "russian" )
do_test( 6, 1944, {
"pf": [ False, False, False, False, False, False, False ],
"thh": [ False, False, False, False ]
} )
do_test( 7, 1944, {
"pf": [ False, False, False, True, False, False, False ],
"thh": [ False, False, False, False ]
} )
# do the tests
set_player( 1, "hungarian" )
do_test( 5, 1944, {
"pf": [ False, False, False, False, False, False, False ],
"thh": [ False, False, False, False ]
} )
do_test( 6, 1944, {
"pf": [ False, False, False, False, True, False, False ],
"thh": [ False, False, False, False ]
} )
do_test( 1, 1945, {
"pf": [ False, False, False, False, True, False, False ],
"thh": [ False, False, False, False ]
} )
# do the tests
set_player( 1, "romanian" )
do_test( 2, 1944, {
"pf": [ False, False, False, False, False, False, False ],
"thh": [ False, False, False, False ]
} )
do_test( 3, 1944, {
"pf": [ False, False, False, False, False, True, False ],
"thh": [ False, False, False, False ]
} )
do_test( 1, 1945, {
"pf": [ False, False, False, False, False, False, True ],
"thh": [ False, False, False, False ]
} )

@ -143,8 +143,8 @@ def test_nationality_specific( webapp, webdriver ): #pylint: disable=too-many-lo
btn = find_child( "button[data-id='psk']" )
expected = "====> whoosh! ; col=[OBCOL:german]/[OBCOL-BORDER:german]"
do_check_snippets( btn, (1942,1), expected, True )
do_check_snippets( btn, (1943,9), expected, True )
do_check_snippets( btn, (1943,10), expected, False )
do_check_snippets( btn, (1943,8), expected, True )
do_check_snippets( btn, (1943,9), expected, False )
do_check_snippets( btn, (1944,1), expected, False )
# initialize

@ -37,6 +37,9 @@ _STD_TEMPLATES = {
# nationality-specific templates
_NAT_TEMPLATES = {
"german": [ "pf", "psk", "atmm" ],
"finnish": [ "pf-finnish" ],
"hungarian": [ "pf-hungarian" ],
"romanian": [ "pf-romanian" ],
"russian": [ "mol", "mol-p" ],
"american": [ "baz" ],
"british": [ "piat" ],

Loading…
Cancel
Save