From 1d893a1d973965da56d2017cd0d406f0ff22f7fd Mon Sep 17 00:00:00 2001 From: Tony Date: Fri, 10 Dec 2021 10:18:48 -0600 Subject: [PATCH] consolidated player-table to consolidate, had to move the filtering to the context instead of the template (probably the right way to do it anyway) also switched from using display to using class to hide cells (also probably the more right/consistent way to do this) --- teamsnap/templates/teamsnap/lineup.html | 60 ++++--------- .../teamsnap/player-table-header.html | 8 -- .../templates/teamsnap/player-table-row.html | 72 ---------------- teamsnap/templates/teamsnap/player-table.html | 86 +++++++++++++++++++ teamsnap/views.py | 8 +- 5 files changed, 108 insertions(+), 126 deletions(-) delete mode 100644 teamsnap/templates/teamsnap/player-table-header.html delete mode 100644 teamsnap/templates/teamsnap/player-table-row.html create mode 100644 teamsnap/templates/teamsnap/player-table.html diff --git a/teamsnap/templates/teamsnap/lineup.html b/teamsnap/templates/teamsnap/lineup.html index 5337426..14d0dd1 100644 --- a/teamsnap/templates/teamsnap/lineup.html +++ b/teamsnap/templates/teamsnap/lineup.html @@ -17,28 +17,14 @@
Lineup
- - {% include 'teamsnap/player-table-header.html' %} - - {% for form in formset %} - {% if form.instance.sequence or form.instance.label == "P" %} - {% include 'teamsnap/player-table-row.html' with form=form available_display="none" sequence_display="table-cell" %} - {% endif %} - {% endfor %} - -
+ {% include 'teamsnap/player-table.html' with table_id="lineup" formset=formset_lineup available_class="d-none"%}
-
Subs
+
DH'd
- - {% include 'teamsnap/player-table-header.html' %} - - - -
+ {% include 'teamsnap/player-table.html' with table_id="dhd" formset=formset_dhd available_class="d-none" sequence_class="d-none"%}
@@ -48,19 +34,7 @@
Bench
- - {% include 'teamsnap/player-table-header.html' %} - - {% for form in formset %} - {% if not form.instance.member.is_non_player %} - {% if not form.instance.sequence and not form.instance.label == "P" %} - {% include 'teamsnap/player-table-row.html' with form=form available_display="table-cell" sequence_display="none" %} - {% endif %} - {% endif %} - {% endfor %} - -
- + {% include 'teamsnap/player-table.html' with table_id="bench" formset=formset_bench sequence_class="d-none"%}
@@ -68,7 +42,7 @@ - +