From 650a6f86d4de606ee92d4ddd81a3d1ac01673b9d Mon Sep 17 00:00:00 2001 From: Pacman Ghost Date: Sun, 4 Sep 2022 21:13:47 +1000 Subject: [PATCH] Grouped notes in Nationality Capabilities snippets. --- .../data/default-template-pack/nat_caps.j2 | 15 +- .../national-capabilities.json | 190 ++++++++++++++---- vasl_templates/webapp/static/nat_caps.js | 46 ++++- .../tests/fixtures/nat-caps/american/1940.txt | 8 +- .../tests/fixtures/nat-caps/american/1941.txt | 8 +- .../tests/fixtures/nat-caps/american/1942.txt | 8 +- .../tests/fixtures/nat-caps/american/1943.txt | 8 +- .../tests/fixtures/nat-caps/american/1944.txt | 8 +- .../tests/fixtures/nat-caps/american/1945.txt | 8 +- .../tests/fixtures/nat-caps/belgian/1940.txt | 4 +- .../tests/fixtures/nat-caps/belgian/1941.txt | 4 +- .../tests/fixtures/nat-caps/belgian/1942.txt | 4 +- .../tests/fixtures/nat-caps/belgian/1943.txt | 4 +- .../tests/fixtures/nat-caps/belgian/1944.txt | 4 +- .../tests/fixtures/nat-caps/belgian/1945.txt | 4 +- .../tests/fixtures/nat-caps/british/1940.txt | 18 +- .../tests/fixtures/nat-caps/british/1941.txt | 18 +- .../tests/fixtures/nat-caps/british/1942.txt | 18 +- .../tests/fixtures/nat-caps/british/1943.txt | 18 +- .../tests/fixtures/nat-caps/british/1944.txt | 18 +- .../tests/fixtures/nat-caps/british/1945.txt | 18 +- .../fixtures/nat-caps/british~anzac/1940.txt | 18 +- .../fixtures/nat-caps/british~anzac/1941.txt | 18 +- .../fixtures/nat-caps/british~anzac/1942.txt | 18 +- .../fixtures/nat-caps/british~anzac/1943.txt | 18 +- .../fixtures/nat-caps/british~anzac/1944.txt | 18 +- .../fixtures/nat-caps/british~anzac/1945.txt | 18 +- .../nat-caps/british~australian/1940.txt | 18 +- .../nat-caps/british~australian/1941.txt | 18 +- .../nat-caps/british~australian/1942.txt | 18 +- .../nat-caps/british~australian/1943.txt | 18 +- .../nat-caps/british~australian/1944.txt | 18 +- .../nat-caps/british~australian/1945.txt | 18 +- .../nat-caps/british~canadian/1940.txt | 18 +- .../nat-caps/british~canadian/1941.txt | 18 +- .../nat-caps/british~canadian/1942.txt | 18 +- .../nat-caps/british~canadian/1943.txt | 18 +- .../nat-caps/british~canadian/1944.txt | 18 +- .../nat-caps/british~canadian/1945.txt | 18 +- .../nat-caps/british~newzealand/1940.txt | 18 +- .../nat-caps/british~newzealand/1941.txt | 18 +- .../nat-caps/british~newzealand/1942.txt | 18 +- .../nat-caps/british~newzealand/1943.txt | 18 +- .../nat-caps/british~newzealand/1944.txt | 18 +- .../nat-caps/british~newzealand/1945.txt | 18 +- .../fixtures/nat-caps/bulgarian/1940.txt | 7 +- .../fixtures/nat-caps/bulgarian/1941.txt | 7 +- .../fixtures/nat-caps/bulgarian/1942.txt | 7 +- .../fixtures/nat-caps/bulgarian/1943.txt | 7 +- .../fixtures/nat-caps/bulgarian/1944.txt | 7 +- .../fixtures/nat-caps/bulgarian/1945.txt | 7 +- .../tests/fixtures/nat-caps/burmese/1940.txt | 8 +- .../tests/fixtures/nat-caps/burmese/1941.txt | 8 +- .../tests/fixtures/nat-caps/burmese/1942.txt | 8 +- .../tests/fixtures/nat-caps/burmese/1943.txt | 8 +- .../tests/fixtures/nat-caps/burmese/1944.txt | 8 +- .../tests/fixtures/nat-caps/burmese/1945.txt | 8 +- .../fixtures/nat-caps/chinese~gmd/1940.txt | 4 +- .../fixtures/nat-caps/chinese~gmd/1941.txt | 4 +- .../fixtures/nat-caps/chinese~gmd/1942.txt | 4 +- .../fixtures/nat-caps/chinese~gmd/1943.txt | 4 +- .../fixtures/nat-caps/chinese~gmd/1944.txt | 4 +- .../fixtures/nat-caps/chinese~gmd/1945.txt | 4 +- .../tests/fixtures/nat-caps/croatian/1940.txt | 7 +- .../tests/fixtures/nat-caps/croatian/1941.txt | 7 +- .../tests/fixtures/nat-caps/croatian/1942.txt | 7 +- .../tests/fixtures/nat-caps/croatian/1943.txt | 7 +- .../tests/fixtures/nat-caps/croatian/1944.txt | 7 +- .../tests/fixtures/nat-caps/croatian/1945.txt | 7 +- .../tests/fixtures/nat-caps/danish/1940.txt | 4 +- .../tests/fixtures/nat-caps/danish/1941.txt | 4 +- .../tests/fixtures/nat-caps/danish/1942.txt | 4 +- .../tests/fixtures/nat-caps/danish/1943.txt | 4 +- .../tests/fixtures/nat-caps/danish/1944.txt | 4 +- .../tests/fixtures/nat-caps/danish/1945.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1940.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1941.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1942.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1943.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1944.txt | 4 +- .../tests/fixtures/nat-caps/dutch/1945.txt | 4 +- .../tests/fixtures/nat-caps/finnish/1940.txt | 9 +- .../tests/fixtures/nat-caps/finnish/1941.txt | 9 +- .../tests/fixtures/nat-caps/finnish/1942.txt | 9 +- .../tests/fixtures/nat-caps/finnish/1943.txt | 9 +- .../tests/fixtures/nat-caps/finnish/1944.txt | 9 +- .../tests/fixtures/nat-caps/finnish/1945.txt | 9 +- .../fixtures/nat-caps/free-french/1940.txt | 18 +- .../fixtures/nat-caps/free-french/1941.txt | 18 +- .../fixtures/nat-caps/free-french/1942.txt | 18 +- .../fixtures/nat-caps/free-french/1943.txt | 18 +- .../fixtures/nat-caps/free-french/1944.txt | 18 +- .../fixtures/nat-caps/free-french/1945.txt | 18 +- .../tests/fixtures/nat-caps/german/1940.txt | 9 +- .../tests/fixtures/nat-caps/german/1941.txt | 9 +- .../tests/fixtures/nat-caps/german/1942.txt | 9 +- .../tests/fixtures/nat-caps/german/1943.txt | 9 +- .../tests/fixtures/nat-caps/german/1944.txt | 9 +- .../tests/fixtures/nat-caps/german/1945.txt | 9 +- .../tests/fixtures/nat-caps/greek/1940.txt | 4 +- .../tests/fixtures/nat-caps/greek/1941.txt | 4 +- .../tests/fixtures/nat-caps/greek/1942.txt | 4 +- .../tests/fixtures/nat-caps/greek/1943.txt | 4 +- .../tests/fixtures/nat-caps/greek/1944.txt | 4 +- .../tests/fixtures/nat-caps/greek/1945.txt | 4 +- .../fixtures/nat-caps/hungarian/1940.txt | 7 +- .../fixtures/nat-caps/hungarian/1941.txt | 7 +- .../fixtures/nat-caps/hungarian/1942.txt | 7 +- .../fixtures/nat-caps/hungarian/1943.txt | 7 +- .../fixtures/nat-caps/hungarian/1944.txt | 7 +- .../fixtures/nat-caps/hungarian/1945.txt | 7 +- .../tests/fixtures/nat-caps/italian/1940.txt | 13 +- .../tests/fixtures/nat-caps/italian/1941.txt | 13 +- .../tests/fixtures/nat-caps/italian/1942.txt | 13 +- .../tests/fixtures/nat-caps/italian/1943.txt | 13 +- .../tests/fixtures/nat-caps/italian/1944.txt | 13 +- .../tests/fixtures/nat-caps/italian/1945.txt | 13 +- .../tests/fixtures/nat-caps/japanese/1940.txt | 32 +-- .../tests/fixtures/nat-caps/japanese/1941.txt | 32 +-- .../tests/fixtures/nat-caps/japanese/1942.txt | 32 +-- .../tests/fixtures/nat-caps/japanese/1943.txt | 32 +-- .../tests/fixtures/nat-caps/japanese/1944.txt | 32 +-- .../tests/fixtures/nat-caps/japanese/1945.txt | 32 +-- .../fixtures/nat-caps/kfw/american/1950.txt | 33 +-- .../fixtures/nat-caps/kfw/american/1951.txt | 37 ++-- .../fixtures/nat-caps/kfw/american/1952.txt | 33 +-- .../fixtures/nat-caps/kfw/american/1953.txt | 33 +-- .../fixtures/nat-caps/kfw/british/1950.txt | 14 +- .../fixtures/nat-caps/kfw/british/1951.txt | 14 +- .../fixtures/nat-caps/kfw/british/1952.txt | 18 +- .../fixtures/nat-caps/kfw/british/1953.txt | 18 +- .../fixtures/nat-caps/kfw/kfw-cpva/1950.txt | 4 +- .../fixtures/nat-caps/kfw/kfw-cpva/1951.txt | 4 +- .../fixtures/nat-caps/kfw/kfw-cpva/1952.txt | 4 +- .../fixtures/nat-caps/kfw/kfw-cpva/1953.txt | 4 +- .../fixtures/nat-caps/kfw/kfw-kpa/1950.txt | 28 +-- .../fixtures/nat-caps/kfw/kfw-kpa/1951.txt | 28 +-- .../fixtures/nat-caps/kfw/kfw-kpa/1952.txt | 28 +-- .../fixtures/nat-caps/kfw/kfw-kpa/1953.txt | 28 +-- .../fixtures/nat-caps/kfw/kfw-ounc/1950.txt | 7 +- .../fixtures/nat-caps/kfw/kfw-ounc/1951.txt | 7 +- .../fixtures/nat-caps/kfw/kfw-ounc/1952.txt | 7 +- .../fixtures/nat-caps/kfw/kfw-ounc/1953.txt | 7 +- .../fixtures/nat-caps/kfw/kfw-rok/1950.txt | 20 +- .../fixtures/nat-caps/kfw/kfw-rok/1951.txt | 20 +- .../fixtures/nat-caps/kfw/kfw-rok/1952.txt | 16 +- .../fixtures/nat-caps/kfw/kfw-rok/1953.txt | 16 +- .../tests/fixtures/nat-caps/polish/1940.txt | 4 +- .../tests/fixtures/nat-caps/polish/1941.txt | 4 +- .../tests/fixtures/nat-caps/polish/1942.txt | 4 +- .../tests/fixtures/nat-caps/polish/1943.txt | 4 +- .../tests/fixtures/nat-caps/polish/1944.txt | 4 +- .../tests/fixtures/nat-caps/polish/1945.txt | 4 +- .../tests/fixtures/nat-caps/romanian/1940.txt | 7 +- .../tests/fixtures/nat-caps/romanian/1941.txt | 7 +- .../tests/fixtures/nat-caps/romanian/1942.txt | 7 +- .../tests/fixtures/nat-caps/romanian/1943.txt | 7 +- .../tests/fixtures/nat-caps/romanian/1944.txt | 7 +- .../tests/fixtures/nat-caps/romanian/1945.txt | 7 +- .../fixtures/nat-caps/slovakian/1940.txt | 7 +- .../fixtures/nat-caps/slovakian/1941.txt | 7 +- .../fixtures/nat-caps/slovakian/1942.txt | 7 +- .../fixtures/nat-caps/slovakian/1943.txt | 7 +- .../fixtures/nat-caps/slovakian/1944.txt | 7 +- .../fixtures/nat-caps/slovakian/1945.txt | 7 +- .../tests/fixtures/nat-caps/swedish/1940.txt | 8 +- .../tests/fixtures/nat-caps/swedish/1941.txt | 8 +- .../tests/fixtures/nat-caps/swedish/1942.txt | 8 +- .../tests/fixtures/nat-caps/swedish/1943.txt | 8 +- .../tests/fixtures/nat-caps/swedish/1944.txt | 8 +- .../tests/fixtures/nat-caps/swedish/1945.txt | 8 +- .../fixtures/nat-caps/yugoslavian/1940.txt | 4 +- .../fixtures/nat-caps/yugoslavian/1941.txt | 4 +- .../fixtures/nat-caps/yugoslavian/1942.txt | 4 +- .../fixtures/nat-caps/yugoslavian/1943.txt | 4 +- .../fixtures/nat-caps/yugoslavian/1944.txt | 4 +- .../fixtures/nat-caps/yugoslavian/1945.txt | 4 +- .../tests/test_national_capabilities.py | 43 ++-- 178 files changed, 1429 insertions(+), 841 deletions(-) diff --git a/vasl_templates/webapp/data/default-template-pack/nat_caps.j2 b/vasl_templates/webapp/data/default-template-pack/nat_caps.j2 index 8d64ca8..de7bc17 100644 --- a/vasl_templates/webapp/data/default-template-pack/nat_caps.j2 +++ b/vasl_templates/webapp/data/default-template-pack/nat_caps.j2 @@ -7,6 +7,7 @@ td { padding: 2px 5px ; } li.comment { font-size: 96% ; font-style: italic ; color: #404040 ; } span.comment { font-size: 85% ; font-style: italic ; color: #404040 ; } +.note-group { margin-top: 5px ; padding-top: 3px ; border-top: 1px solid #ccc ; } @@ -30,18 +31,20 @@ span.comment { font-size: 85% ; font-style: italic ; color: #404040 ; } {%if NAT_CAPS.OBA_BLACK%}
  • OBA: {{NAT_CAPS.OBA_BLACK}} {{NAT_CAPS.OBA_RED}} {%if NAT_CAPS.OBA_ACCESS%} (access: {{NAT_CAPS.OBA_ACCESS}}) {%endif%} - {%if NAT_CAPS.OBA_COMMENTS%} {%endif%} {%endif%} -{%if NAT_CAPS.NOTES%} - -{%endif%} +{% for group in NAT_CAPS.NOTE_GROUPS %} +
    +{%if group.CAPTION %}
    {{group.CAPTION}}
    {%endif%} +{%if group.NOTES %}
      {%for note in group.NOTES%} +
    • {{note}} {%endfor%} +
    {%endif%} +
    +{%endfor%} {%else%} diff --git a/vasl_templates/webapp/data/default-template-pack/national-capabilities.json b/vasl_templates/webapp/data/default-template-pack/national-capabilities.json index 7a02052..39600d0 100644 --- a/vasl_templates/webapp/data/default-template-pack/national-capabilities.json +++ b/vasl_templates/webapp/data/default-template-pack/national-capabilities.json @@ -8,7 +8,11 @@ "notes": [ "{? 10/1943- | Inherent PF | No Inherent PF | Inherent PF10/43+ ?}", "{? 01/1944- | Inherent ATMM | No Inherent ATMM | Inherent ATMM44+ ?}", - "SS: " + { "caption": "SS", "notes": [ + "Disrupt & RtPh Surrender NA
    vs Russians", + "Massacre OK", + "{? 01/1944- | Squad Assault Fire | No Squad Assault Fire | Squad Assault Fire44+ ?}" + ] } ] }, @@ -34,7 +38,11 @@ "hob_drm": "0 DRM", "grenades": "SMOKE", "notes": [ - "U.S.M.C.: " + { "caption": "U.S.M.C.", "notes": [ + "Disruption NA", + "7-6-8 can Self-Deploy", + "Vehicle [EXC: LC] Crew: Army 1-2-6" + ] } ] }, "kfw-american": { @@ -46,14 +54,30 @@ "hob_drm": [ "0 DRM", "+3 for Katusa; NA for TACP" ], "grenades": "SMOKE", "notes": [ - "Rangers: 6-6-8 ", - "Airborne: 6-6-7", "{! 06/1950-08/1950 = Early KW U.S. Army rules: !}", - "Katusa: As U.S. Army MMC ", "Disruption NA", "7-6-8 can Self-Deploy", "Use 5-5-8 when: ", - "Tactical Air Control Party: " + { "caption": "Rangers (6-6-8)", "notes": [ + "Self-Rally OK", + "Self-Deploy (1TC) & Self-Recombine OK", + "Cowering NA", + "Commandos", + "No Non-Qualified Use penalty for RCL", + "No Captured Use penalty for Communist SW" + ] }, + { "caption": "Airborne (6-6-7)", "allow_empty": true }, + { "caption": "Katusa", "notes": [ + "As U.S. Army MMC", + "HoB +3 DRM", + "Leader Creation +1 drm", + "{! 09/1950-10/1951 = ELR 2 !}", + "{! 09/1950-10/1951 = Allied Troop penalties with U.S. leaders !}" + ] }, + { "caption": "Tactical Air Control Party", "notes": [ + "Inherent Radio (Contact = 9)", + "May set up HIP" + ] } ] }, @@ -63,9 +87,18 @@ "hob_drm": "-1 DRM", "grenades": "{? 01/1944- | SMOKE | Smoke | SMOKE44+ ?}", "notes": [ - "Elite & 1st Line: Cowering NA", - "ANZAC: Stealthy (unless Green)", - "Gurkha: " + { "caption": "Elite & 1st Line", "notes": [ + "Cowering NA" + ] }, + { "caption": "ANZAC", "notes": [ + "Stealthy (unless Green)" + ] }, + { "caption": "Gurkha", "notes": [ + "-1 CC DRM", + "Disrupt & RtPh Surrender NA", + "Commando (unless Green)", + "Stealthy" + ] } ] }, @@ -73,8 +106,7 @@ "th_color": [ "Black", "AFV use Red TH#" ], "oba": [ "6B", "2R" ], "oba_access": "≤ 1", "hob_drm": "+1 DRM", - "grenades": "Smoke", - "notes": [] + "grenades": "Smoke" }, "italian": { @@ -84,7 +116,13 @@ "grenades": "Smoke", "notes": [ "Escape NA", - "1st Line & Conscript: " + { "caption": "1st Line & Conscript", "notes": [ + "Surrender on HoB Final DR ≥ 10", + "Deploy NA", + "+1 CC Capture DRM NA", + "Always Lax", + "1 PAATC" + ] } ] }, @@ -102,10 +140,14 @@ "Deploy (1TC) & Recombine without Leader", "Self-Rally OK [EXC: Conscript]", "Cowering NA [EXC: Conscript]", - "Elite & 1st Line: ", "Ski-trained (don Skis = one MF)", "Leader Creation NA", - "Captured Use penalties NA for Russian MG
    [EXC: LMG in 1939; .50-cal]" + "Captured Use penalties NA for Russian MG
    [EXC: LMG in 1939; .50-cal]", + { "caption": "Elite & 1st Line", "notes": [ + "Always Stealthy", + "Use FT/DC as Elite", + "{? 07/1944- | Inherent PF | No Inherent PF | Inherent PF7/44+ ?}" + ] } ] }, @@ -114,9 +156,13 @@ "oba": [ "6B", "3R"], "hob_drm": "0 DRM", "notes": [ - "1st Line Battle Hardening → Fanatic", - "Allied Troops Captured Use penalties NA", - "Extreme Winter effects NA" + "Extreme Winter effects NA", + { "caption": "1st Line", "notes": [ + "Battle Hardening → Fanatic" + ] }, + { "caption": "Allied Troops", "notes": [ + "Captured Use penalties NA" + ] } ] }, @@ -127,9 +173,12 @@ "grenades": "Smoke", "notes": [ "Escape NA", - "1st Line & Conscript: ", "{? 03/1944- | Inherent PF in non-Crew MMC (Romanian3/44+; Hungarian6/44+) | No Inherent PF | Inherent PF (Romanian3/44+; Hungarian6/44+) ?}", - "{? 07/1943- | Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM) | No Inherent ATMM | Inherent ATMM(7/43+) ?}" + "{? 07/1943- | Inherent ATMM in Romanian non-Crew Elite & 1st Line MMC (-2 CC DRM) | No Inherent ATMM | Inherent ATMM(7/43+) ?}", + { "caption": "1st Line & Conscript", "notes": [ + "1 PAATC", + "Surrender on HoB Final DR ≥ 10" + ] } ] }, @@ -140,7 +189,9 @@ "grenades": "Smoke", "notes": [ "+1 Broken Morale vs Italians", - "1st Line & Green: 1 PAATC" + { "caption": "1st Line & Green", "notes": [ + "1 PAATC" + ] } ] }, @@ -151,19 +202,34 @@ "grenades": "SMOKE", "notes": [ "SMC PTC/Pin/Break NA", - "Leaders: ", "Tank-Hunter Heroes & ATMM", "Banzai Charge (always Lax)", - "Elite & 1st Line: Always Stealthy", - "Conscript: Always Lax", "ATR/MMG/HMG Breakdown penalty", - "Always NA: ", "LLMC → LLTC if unbroken", "Massacre OK", "-1 Interrogation DRM", "-2 Concealment drm", "Enemy +2 search drm", - "Hand-to-Hand CC & Hara-Kiri" + "Hand-to-Hand CC & Hara-Kiri", + { "caption": "Leaders", "notes": [ + "Replacement NA", + "Casualty MC → elimination", + "Morale/Rally/Berserk as Commissar" + ] }, + { "caption": "Elite & 1st Line", "notes": [ + "Always Stealthy" + ] }, + { "caption": "Conscript", "notes": [ + "Always Lax" + ] }, + { "caption": "Always NA", "notes": [ + "PAATC", + "Escape", + "RtPh Surrender", + "Disruption", + "Encircled lower Morale", + "Leader Creation" + ] } ] }, @@ -180,9 +246,11 @@ "Deploy NA", "Lax at Night", "+1 Leader Creation drm", - "1st Line & Conscript: 1 PAATC", "Human Wave", - "Dare-Death Squads [EXC: 5-3-7]" + "Dare-Death Squads [EXC: 5-3-7]", + { "caption": "1st Line & Conscript", "notes": [ + "1 PAATC" + ] } ] }, @@ -222,8 +290,16 @@ "hob_drm": "+3/+4 DRM", "grenades": "SMOKE", "notes": [ - "Republic of Korea (ROK): ", - "Korean Marine Corps (KMC): " + { "caption": "Republic of Korea (ROK)", "notes": [ + "{! 06/1946-04/1951 = Early KW ROK rules !}", + "1st Line MMC: ", + "2nd Line & Conscript MMC: