From da60cad9116388a4839f4f356a49fea81a3ea60d Mon Sep 17 00:00:00 2001 From: Arona Jones Date: Mon, 24 Aug 2020 13:43:03 +0100 Subject: [PATCH] Mooooore status chips, mooore --- RIGS/hs.py | 6 ++ RIGS/templates/base_rigs.html | 1 + RIGS/templates/event_checklist_list.html | 71 +++++++++++++++++++++++ RIGS/templates/partials/event_status.html | 35 +++++++++-- RIGS/templates/partials/hs_details.html | 4 +- RIGS/templates/risk_assessment_list.html | 2 +- RIGS/urls.py | 2 + 7 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 RIGS/templates/event_checklist_list.html diff --git a/RIGS/hs.py b/RIGS/hs.py index 9e9752ee..68d0a3d3 100644 --- a/RIGS/hs.py +++ b/RIGS/hs.py @@ -135,3 +135,9 @@ class EventChecklistCreate(generic.CreateView): def get_success_url(self): return reverse_lazy('ec_detail', kwargs={'pk': self.object.pk}) + + +class EventChecklistList(generic.ListView): + paginate_by = 20 + model = models.EventChecklist + template_name = 'event_checklist_list.html' diff --git a/RIGS/templates/base_rigs.html b/RIGS/templates/base_rigs.html index 46b1d2da..3f5b5026 100644 --- a/RIGS/templates/base_rigs.html +++ b/RIGS/templates/base_rigs.html @@ -60,6 +60,7 @@ {% endif %} diff --git a/RIGS/templates/event_checklist_list.html b/RIGS/templates/event_checklist_list.html new file mode 100644 index 00000000..8fc5fe95 --- /dev/null +++ b/RIGS/templates/event_checklist_list.html @@ -0,0 +1,71 @@ +{% extends 'base_rigs.html' %} +{% load paginator from filters %} +{% load help_text from filters %} +{% load verbose_name from filters %} + +{% block title %}Event Checklist List{% endblock %} + +{% block content %} +
+
+

Event Checklist List

+
+
+
+
+
+ + + + + {# mmm hax #} + {% if object_list.0 %} + + + + + + + + + + + + + + + {% endif %} + + + + {% for object in object_list %} + + {# General #} + + + {# Buttons #} + + + {% empty %} + + + + {% endfor %} + +
Event{{ object_list.0|verbose_name:'power_mic'|title }}{{ object_list.0|verbose_name:'vehicles'|title }}{{ object_list.0|verbose_name:'safe_parking'|title }}{{ object_list.0|verbose_name:'safe_packing'|title }}{{ object_list.0|verbose_name:'exits'|title }}{{ object_list.0|verbose_name:'trip_hazard'|title }}{{ object_list.0|verbose_name:'warning_signs'|title }}{{ object_list.0|verbose_name:'ear_plugs'|title }}{{ object_list.0|verbose_name:'hs_location'|title }}{{ object_list.0|verbose_name:'extinguishers_location'|title }}{{ object_list.0|verbose_name:'rcds'|title }}{{ object_list.0|verbose_name:'supply_test'|title }}{{ object_list.0|verbose_name:'earthing'|title }}{{ object_list.0|verbose_name:'pat'|title }}
N{{ object.event.pk|stringformat:"05d" }} {{ object.event.name }}{{object.power_mic.name}} + View + {% if object.reviewed_by %} + Reviewed by {{ object.reviewed_by }} at {{ object.reviewed_at }} + {% else %} + Mark Reviewed + {% endif %} +
No checklists found
+
+
+
+ {% if is_paginated %} +
+ {% paginator %} +
+ {% endif %} +{% endblock %} diff --git a/RIGS/templates/partials/event_status.html b/RIGS/templates/partials/event_status.html index 670305a6..f67275a0 100644 --- a/RIGS/templates/partials/event_status.html +++ b/RIGS/templates/partials/event_status.html @@ -1,19 +1,42 @@ +
Status: {{ event.get_status_display }} {% if event.is_rig %} {% if event.purchase_order %} PO: {{ event.purchase_order }} {% elif event.authorised %} - Payment: Authorised + Authorisation: Complete {% else %} - Payment: + Authorisation: {% endif %} - - {% if not event.dry_hire %} {% if event.riskassessment %} - RA: + RA: {%if event.riskassessment.reviewed_by%}{%endif%} {% else %} - RA: + RA: + {% endif %} + {% else %} + RA: N/A + {% endif %} +
+ {% if not event.dry_hire %} + {% if event.eventchecklist %} + Checklist: {%if event.eventchecklist.reviewed_by%}{%endif%} + {% else %} + Checklist: + {% endif %} + {% endif %} + {% if perms.RIGS.view_invoice %} + {% if event.invoice %} + {% if event.invoice.void %} + Invoice: Void + {% elif event.invoice.is_closed %} + Invoice: Paid + {% else %} + Invoice: Outstanding + {% endif %} + {% else %} + Invoice: Not Generated {% endif %} {% endif %} {% endif %} +
diff --git a/RIGS/templates/partials/hs_details.html b/RIGS/templates/partials/hs_details.html index b423f77c..1bb5c21e 100644 --- a/RIGS/templates/partials/hs_details.html +++ b/RIGS/templates/partials/hs_details.html @@ -1,4 +1,4 @@ -
Edit
{% else %} + class="hidden-xs">Create Event Checklist {% endif%} diff --git a/RIGS/templates/risk_assessment_list.html b/RIGS/templates/risk_assessment_list.html index d3362a3e..e026063b 100644 --- a/RIGS/templates/risk_assessment_list.html +++ b/RIGS/templates/risk_assessment_list.html @@ -92,7 +92,7 @@ {% empty %} - + No risk assessments found {% endfor %} diff --git a/RIGS/urls.py b/RIGS/urls.py index c4f78c29..5e470736 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -111,6 +111,8 @@ urlpatterns = [ name='ec_edit'), path('event/checklist//history/', permission_required_with_403('RIGS.change_event')(versioning.VersionHistory.as_view()), name='ec_history', kwargs={'model': models.EventChecklist}), + path('event/checklist/list', permission_required_with_403('RIGS.change_event')(hs.EventChecklistList.as_view()), + name='ec_list'), # Finance path('invoice/', permission_required_with_403('RIGS.view_invoice')(finance.InvoiceIndex.as_view()),