From 22bba7e8af8bd1e5f1ff9d2a21604407daf41a79 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 16 Mar 2025 22:06:06 +0000 Subject: [PATCH] Introduce new rigboard template --- RIGS/templates/partials/event_table.html | 235 ++++++----------------- 1 file changed, 55 insertions(+), 180 deletions(-) diff --git a/RIGS/templates/partials/event_table.html b/RIGS/templates/partials/event_table.html index cbb17b7e..83b10b33 100644 --- a/RIGS/templates/partials/event_table.html +++ b/RIGS/templates/partials/event_table.html @@ -1,195 +1,70 @@ {% load namewithnotes from filters %} {% load markdown_tags %} + -
-
-
#
-
Dates & Times
-
Event Details
-
MIC
-
- {% for event in events %} -
+ {% for event in events %} +
+ {% comment %} Determine card style based on event status {% endcomment %} + {% if event.cancelled %} + + {% with border_class="border-secondary" header_bg="bg-secondary" header_text="light-link" %} + {% include "partials/event_row.html" %} + {% endwith %} + {% elif not event.is_rig %} - table-info + + {% with border_class="border-primary" header_bg="bg-primary" header_text="light-link" %} + {% include "partials/event_row.html" %} + {% endwith %} + {% elif not event.mic %} - table-danger + + {% with border_class="border-danger" header_bg="bg-danger" header_text="light-link" %} + {% include "partials/event_row.html" %} + {% endwith %} + {% elif event.confirmed and event.authorised %} + {% if event.dry_hire or event.riskassessment %} - table-success + + {% with border_class="border-success" header_bg="bg-success" header_text="link-on-green" %} + {% include "partials/event_row.html" %} + {% endwith %} + {% else %} - table-warning + + {% with border_class="border-warning" header_bg="bg-warning" header_text="dark-link" %} + {% include "partials/event_row.html" %} + {% endwith %} + {% endif %} + {% else %} - table-warning - {% endif %}" {% if event.cancelled %}style="opacity: 50% !important;"{% endif %} id="event_row"> - -
{{ event.display_id }}
- -
-
- {% if not event.cancelled %} - {% if event.meet_at %} -
Meet:
-
{{ event.meet_at|date:"D d/m/Y H:i" }}
- {% endif %} - {% if event.access_at %} -
Access:
-
{{ event.access_at|date:"D d/m/Y H:i" }}
- {% endif %} - {% endif %} -
Start:
-
{{ event.start_date|date:"D d/m/Y" }} - {% if event.has_start_time %} - {{ event.start_time|date:"H:i" }} - {% endif %} -
- {% if event.end_date %} -
End:
-
{{ event.end_date|date:"D d/m/Y" }} - {% if event.has_end_time %} - {{ event.end_time|date:"H:i" }} - {% endif %} -
- {% endif %} -
+ + {% with border_class="border-warning" header_bg="bg-warning" header_text="dark-link" %} + {% include "partials/event_row.html" %} + {% endwith %} + + {% endif %} +
+ {% empty %} +
+
+ No events currently scheduled.
- -
-

- - {{ event }}{{ event.name }} - - {% if event.dry_hire %} - Dry Hire - {% endif %} -
- {% if event.venue %} - at {{ event.venue|namewithnotes:'venue_detail' }} - {% endif %} -

- {% if event.is_rig and not event.cancelled %} -
- {{ event.person.name }} - {% if event.organisation %} - for {{ event.organisation.name }} - {% endif %} -
- {% endif %} - {% if not event.cancelled and event.description %} -

{{ event.description|markdown }}

- {% endif %} -
- {% include 'partials/event_status.html' %} - -
- MIC: - {% if event.mic %} - {% if perms.RIGS.view_profile %} - - {% endif %} - - {{ event.mic }} - {% if perms.RIGS.view_profile %} - - {% endif %} - {% elif event.is_rig %} - - {% endif %} -
-
-{% endfor %} -
+
+ {% endfor %}