From 30b323cd7be83809e3ef6208bbf9668864f3b290 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Wed, 27 Nov 2019 21:14:02 +0000 Subject: [PATCH] CHANGE: First pass at opening up RIGS #233 Whilst it makes it something of a misnomer, the intent is to make the 'view_event' perm a permission to view event details like client/price. I don't see the point in giving everyone 'view_event' and adding a new 'view_event_detail'...Open to arguments the other way. --- RIGS/templates/RIGS/event_detail.html | 14 +++++++++----- RIGS/templates/RIGS/event_table.html | 2 +- RIGS/templates/RIGS/item_row.html | 6 ++++-- RIGS/templates/RIGS/item_table.html | 4 ++++ RIGS/urls.py | 9 ++++----- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index 6a18d2f3..d7f1a4b2 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -10,12 +10,14 @@ | {{ object.name }} {% if event.dry_hire %}Dry Hire{% endif %} + {% if perms.RIGS.view_event %}
{% include 'RIGS/event_detail_buttons.html' %}
+ {% endif %} {% endif %} - {% if object.is_rig %} + {% if object.is_rig and perms.RIGS.view_event %} {# only need contact details for a rig #}
@@ -147,7 +149,7 @@
{{ object.collector }}
{% endif %} - {% if event.is_rig and not event.internal %} + {% if event.is_rig and not event.internal and perms.RIGS.view_event %}
 
PO
{{ object.purchase_order }}
@@ -156,7 +158,7 @@
- {% if event.is_rig and event.internal %} + {% if event.is_rig and event.internal and perms.RIGS.view_event %}
Client Authorisation
@@ -204,7 +206,7 @@
{% endif %} - {% if not request.is_ajax %} + {% if not request.is_ajax and perms.RIGS.view_event %}
{% include 'RIGS/event_detail_buttons.html' %}
@@ -214,15 +216,17 @@
Event Details
+ {% if perms.RIGS.view_event %}

Notes

{{ event.notes|linebreaksbr }}
+ {% endif %} {% include 'RIGS/item_table.html' %}
- {% if not request.is_ajax %} + {% if not request.is_ajax and perms.RIGS.view_event %}
{% include 'RIGS/event_detail_buttons.html' %}
diff --git a/RIGS/templates/RIGS/event_table.html b/RIGS/templates/RIGS/event_table.html index c84b6624..f1bdb5f6 100644 --- a/RIGS/templates/RIGS/event_table.html +++ b/RIGS/templates/RIGS/event_table.html @@ -33,7 +33,7 @@

- + {{ event.name }} {% if event.venue %} diff --git a/RIGS/templates/RIGS/item_row.html b/RIGS/templates/RIGS/item_row.html index 656d9812..beb4bd75 100644 --- a/RIGS/templates/RIGS/item_row.html +++ b/RIGS/templates/RIGS/item_row.html @@ -6,17 +6,19 @@ {{item.description|linebreaksbr}}

+ {% if perms.RIGS.view_event %} £ {{item.cost|floatformat:2}} {{item.quantity}} £ {{item.total_cost|floatformat:2}} + {% endif %} {% if edit %} - - diff --git a/RIGS/templates/RIGS/item_table.html b/RIGS/templates/RIGS/item_table.html index 0c652daf..ce2013b9 100644 --- a/RIGS/templates/RIGS/item_table.html +++ b/RIGS/templates/RIGS/item_table.html @@ -3,9 +3,11 @@ Item + {% if perms.RIGS.view_event %} Price Quantity Sub-total + {% endif %} {% if edit %}