aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/templates
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2017-11-01 00:10:47 -0400
committerMitch Riedstra <mitch@riedstra.us>2017-11-01 00:10:47 -0400
commite4d865b1a61f6a72551e70abad78c6c35b9345e7 (patch)
tree7173d343aa38586b2ce8e9205e0e6f7fd6cd6564 /app/dispatch/templates
parentb7d282a8ba5f0ed6c773989c96c2182257cc69a5 (diff)
downloaddispatch-tracker-e4d865b1a61f6a72551e70abad78c6c35b9345e7.tar.gz
dispatch-tracker-e4d865b1a61f6a72551e70abad78c6c35b9345e7.tar.xz
Fix user permissions. Hide generate invoice on the summary page if it is empty. Hide load delete option from regular users as they don't have permission anyway
Diffstat (limited to 'app/dispatch/templates')
-rw-r--r--app/dispatch/templates/dispatch/drivers/summary.html3
-rw-r--r--app/dispatch/templates/dispatch/loads/detail.html4
2 files changed, 7 insertions, 0 deletions
diff --git a/app/dispatch/templates/dispatch/drivers/summary.html b/app/dispatch/templates/dispatch/drivers/summary.html
index d849e9d..5da7d3c 100644
--- a/app/dispatch/templates/dispatch/drivers/summary.html
+++ b/app/dispatch/templates/dispatch/drivers/summary.html
@@ -10,6 +10,8 @@
</div>
</div>
+<!-- don't show the invoice button if we don't have any loads lol -->
+{% if loads_nosplit.all %}
<div class="row">
<div class="col s12">
<div class="right-align">
@@ -17,6 +19,7 @@
</div>
</div>
</div>
+{% endif %}
{% if not request.user.is_superuser %}
<div class="row">
diff --git a/app/dispatch/templates/dispatch/loads/detail.html b/app/dispatch/templates/dispatch/loads/detail.html
index 5be54a1..288fdd8 100644
--- a/app/dispatch/templates/dispatch/loads/detail.html
+++ b/app/dispatch/templates/dispatch/loads/detail.html
@@ -10,11 +10,15 @@
</div>
<div class="col s6">
<div class="right-align">
+ {% if request.user.is_superuser %}
<form action="{% url 'load_delete' object.id %}" id="load_delete" method="POST">
{% csrf_token %}
<a class="btn red" href="#" onClick="warn_submit('Are you sure?\nThis cannot be undone!', '#load_delete')">Delete</a>
<a class="btn blue" href="{% url 'load_edit' object.id %}">Edit</a>
</form>
+ {% else %}
+ <a class="btn blue" href="{% url 'load_edit' object.id %}">Edit</a>
+ {% endif %}
</div>
</div>
</div>