diff options
| author | Mitch Riedstra <Mitch@riedstra.us> | 2017-10-30 14:52:45 -0400 |
|---|---|---|
| committer | Mitch Riedstra <Mitch@riedstra.us> | 2017-10-30 14:52:45 -0400 |
| commit | 1949503b55ea622d7c466e4b433f4d90e7eff125 (patch) | |
| tree | 26ba248d8a2e099eb2442e0e053004e3ba6d0644 /app | |
| parent | cf26245f4efe9ac133f5c874058ed3116fb0ac55 (diff) | |
| download | dispatch-tracker-1949503b55ea622d7c466e4b433f4d90e7eff125.tar.gz dispatch-tracker-1949503b55ea622d7c466e4b433f4d90e7eff125.tar.xz | |
Fixed the delete button for Invoices
Diffstat (limited to 'app')
| -rw-r--r-- | app/dispatch/templates/dispatch/invoice/detail.html | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/dispatch/templates/dispatch/invoice/detail.html b/app/dispatch/templates/dispatch/invoice/detail.html index d7b30f6..0d83569 100644 --- a/app/dispatch/templates/dispatch/invoice/detail.html +++ b/app/dispatch/templates/dispatch/invoice/detail.html @@ -19,8 +19,12 @@ <div class="col s12"> <div class="right-align"> - <a class="btn red" href="{% url 'invoice_delete' object.pk%}">Delete</a> + <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 green" href="#" onClick="window.print()">Print</a> + </form> </div> </div> @@ -35,4 +39,16 @@ <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%} |
