diff --git a/app/web/templates/_summary_cards.html b/app/web/templates/_summary_cards.html new file mode 100644 index 0000000..036a8c4 --- /dev/null +++ b/app/web/templates/_summary_cards.html @@ -0,0 +1,9 @@ +
+ {% for card in summary_cards %} +
+

{{ card.label }}

+

{{ card.value }}

+

{{ card.caption }}

+
+ {% endfor %} +
diff --git a/app/web/templates/_selector_form.html b/app/web/templates/_team_selector_form.html similarity index 90% rename from app/web/templates/_selector_form.html rename to app/web/templates/_team_selector_form.html index 53abacd..75ce4f2 100644 --- a/app/web/templates/_selector_form.html +++ b/app/web/templates/_team_selector_form.html @@ -1,6 +1,6 @@ -{# Shared team/season/window controls. Both metric pages post to their own path - via form_action, so one selector serves both without a second selection - system. The route validates the team-season pair on every request. #} +{# Team-only GET controls for team_id, season, and window. Each Team metric + supplies form_action; the Team-season catalog supports season-selector.js. + Routes validate the Team-season pair even without JavaScript. #}
diff --git a/app/web/templates/baserunners.html b/app/web/templates/baserunners.html index 073ed83..3ae94a6 100644 --- a/app/web/templates/baserunners.html +++ b/app/web/templates/baserunners.html @@ -34,7 +34,7 @@

No team data has been imported yet

{{ import_command }}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -72,15 +72,7 @@

{{ analysis.team_name }} — Baserunners per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -65,15 +65,9 @@

{{ analysis.team_name }} — Hits vs Batting Strikeouts

-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% with summary_class="summary summary--comparison", summary_label="Comparison summary statistics" %} + {% include "_summary_cards.html" %} + {% endwith %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -72,15 +72,7 @@

{{ analysis.team_name }} — Hits Allowed per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -51,15 +51,7 @@

{{ analysis.team_name }} — Hits per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -71,15 +71,7 @@

{{ analysis.team_name }} — Pitches per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -73,15 +73,7 @@

{{ analysis.team_name }} — Run Differential per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -51,15 +51,7 @@

{{ analysis.team_name }} — Runs Scored per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}
{% else %} - {% include "_selector_form.html" %} + {% include "_team_selector_form.html" %} {% if state == "not_found" %}
@@ -70,15 +70,7 @@

{{ analysis.team_name }} — Batting Strikeouts per Game

{{ chart_html | safe }}
-
- {% for card in summary_cards %} -
-

{{ card.label }}

-

{{ card.value }}

-

{{ card.caption }}

-
- {% endfor %} -
+ {% include "_summary_cards.html" %}