Add a cancel job button

If you schedule a job you might change your mind or circumstances might
change. So you need to be able to cancel it. This commit adds a button
on the job page which hits the `…/cancel` API endpoint for a job.
This commit is contained in:
Chris Hill-Scott
2016-09-01 15:40:49 +01:00
parent c94675f457
commit eb11615a32
5 changed files with 68 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
{% from "components/table.html" import list_table, field, right_aligned_field_heading, date_field, row_heading %}
{% from "components/page-footer.html" import page_footer %}
<div class="ajax-block-container">
{% if job.job_status == 'scheduled' %}
@@ -6,6 +7,14 @@
<p>
Sending will start at {{ job.scheduled_for|format_time }}
</p>
<div class="page-footer">
<form method="post">
{{ page_footer(
button_text="Cancel sending",
destructive=True
) }}
</form>
</div>
{% else %}