aboutsummaryrefslogtreecommitdiff
path: root/app/dispatch/templates
diff options
context:
space:
mode:
authorMitch Riedstra <Mitch@riedstra.us>2017-10-30 17:06:23 -0400
committerMitch Riedstra <Mitch@riedstra.us>2017-10-30 17:06:23 -0400
commitec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5 (patch)
tree6ae862656a003d683f537d078599f98bbfa2675d /app/dispatch/templates
parent1949503b55ea622d7c466e4b433f4d90e7eff125 (diff)
downloaddispatch-tracker-ec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5.tar.gz
dispatch-tracker-ec9428fdf76b5d70d0f3bcdff3b85e3a83d5f3d5.tar.xz
Proper redirect on edit for users. Delete for loads, warning on delete. Invoice view ordered by PK desc
Diffstat (limited to 'app/dispatch/templates')
-rw-r--r--app/dispatch/templates/dispatch/invoice/detail.html26
-rw-r--r--app/dispatch/templates/dispatch/loads/delete.html0
-rw-r--r--app/dispatch/templates/dispatch/loads/detail.html54
3 files changed, 46 insertions, 34 deletions
diff --git a/app/dispatch/templates/dispatch/invoice/detail.html b/app/dispatch/templates/dispatch/invoice/detail.html
index 0d83569..033747c 100644
--- a/app/dispatch/templates/dispatch/invoice/detail.html
+++ b/app/dispatch/templates/dispatch/invoice/detail.html
@@ -4,9 +4,19 @@
{% block content %}
<div class="row hide-print">
- <div class="col s12">
+ <div class="col s12 m6">
<h1>Invoice for {{object.invoice_date}} by {{object.owner}}</h1>
</div>
+ <div class="col s12 m6">
+ <div class="right-align">
+ <form action="{% url 'invoice_delete' object.pk %}" id="invoice_delete" method="POST">
+ <!-- <input type="submit" class="btn red" value="Delete" /> -->
+ {% csrf_token %}
+ <a class="btn red" href="#" onClick="warn_submit('Are you sure?', '#invoice_delete')">Delete</a>
+ <a class="btn green" href="#" onClick="window.print()">Print</a>
+ </form>
+ </div>
+ </div>
</div>
<div style="padding-top:30px;" class="hide-print"></div>
@@ -22,7 +32,7 @@
<form action="{% url 'invoice_delete' object.pk %}" id="invoice_delete" method="POST">
<!-- <input type="submit" class="btn red" value="Delete" /> -->
{% csrf_token %}
- <a class="btn red" href="#" onClick="delete_load('Are you sure?', '#invoice_delete')">Delete</a>
+ <a class="btn red" href="#" onClick="warn_submit('Are you sure?', '#invoice_delete')">Delete</a>
<a class="btn green" href="#" onClick="window.print()">Print</a>
</form>
</div>
@@ -39,16 +49,4 @@
<link rel="stylesheet" href="/static/print.css" media="print">
<link rel="stylesheet" href="/static/materialize/css/materialize.min.css" media="print">
-<script>
-
-function delete_load(text, form) {
- if(confirm(text)) {
- form = document.querySelector(form)
- form.submit()
- // window.location.href = "{% url 'invoice_delete' object.pk%}";
- }
-}
-
-</script>
-
{%endblock%}
diff --git a/app/dispatch/templates/dispatch/loads/delete.html b/app/dispatch/templates/dispatch/loads/delete.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/app/dispatch/templates/dispatch/loads/delete.html
diff --git a/app/dispatch/templates/dispatch/loads/detail.html b/app/dispatch/templates/dispatch/loads/detail.html
index 62a8b30..3b2ba8d 100644
--- a/app/dispatch/templates/dispatch/loads/detail.html
+++ b/app/dispatch/templates/dispatch/loads/detail.html
@@ -5,16 +5,22 @@
{% block content %}
{% load dynamic_key %}
<div class="row">
- <div class="col s12 m6">
+ <div class="col s6">
<h1>Details for {{object.description}}</h1>
</div>
+ <div class="col s6">
+ <div class="right-align">
+ <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>
+ </div>
+ </div>
</div>
<div class="row">
<div class="col s12">
- <div class="right-align">
- <a class="btn blue" href="{%url 'load_edit' object.id %}">Edit</a>
- </div>
<table class="bordered">
<tr>
<th>Date</th>
@@ -51,36 +57,45 @@
</table>
</div>
+ </div>
+
<div class="row">
- <div class="col s12" style="padding-top: 50px;">
+ <div class="col s6">
<h4>Attached Files:</h4>
-
- <div class="right-align">
- <a class="btn blue" href="{% url 'paperwork_upload' object.id %}">Upload</a>
+ </div>
+ <div class="col s6">
+ <h4></h4>
+ <div class="right-align">
+ <a class="btn blue" href="{% url 'paperwork_upload' object.id %}">Upload</a>
+ </div>
</div>
+ </div>
+
- <table>
+ <div class="row">
+ <div class="col s12">
+ <table>
<thead>
<th>Description: </th>
<th></th>
</thead>
<tbody>
{% for p in paperwork_list %}
- <tr>
- <td>{{p.description}}</td>
- <td class="right-align">
- <a class="btn red" href="{% url 'paperwork_delete' object.id p.id %}">Delete</a>
- <!-- <a class="btn green" target="_blank" href="{{p.document.url}}">Download</a> -->
- <a class="btn green" href="{% url 'paperwork_download' load.id p.id %}">Download</a>
- </td>
- </tr>
+ <tr>
+ <td>{{p.description}}</td>
+ <td class="right-align">
+ <a class="btn red" href="{% url 'paperwork_delete' object.id p.id %}">Delete</a>
+ <!-- <a class="btn green" target="_blank" href="{{p.document.url}}">Download</a> -->
+ <a class="btn green" href="{% url 'paperwork_download' load.id p.id %}">Download</a>
+ </td>
+ </tr>
{% endfor %}
</tbody>
- </table>
+ </table>
+ </div>
</div>
- </div>
<div class="row">
@@ -118,7 +133,6 @@
</ul>
</div>
</div>
- </div>
</div>