Letter job can't be cancelled if already printed

Non-cancellable letter statuses mean that it's too late to cancel a job
This commit is contained in:
Pea Tyczynska
2019-06-18 18:00:36 +01:00
parent b5db1ce61e
commit 4a679a6583
9 changed files with 158 additions and 65 deletions

View File

@@ -3,11 +3,21 @@
{% if job.scheduled_for %}
{% if job.processing_started %}
Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }}
{% if template_type == "letter" %}
<p id="printing-info">
{{ letter_print_day }}
</p>
{% endif %}
{% else %}
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
{% endif %}
{% else %}
Sent by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
{% if template_type == "letter" %}
<p id="printing-info">
{{ letter_print_day }}
</p>
{% endif %}
{% endif %}
</p>
</div>

View File

@@ -21,11 +21,15 @@
{{ ajax_block(partials, updates_url, 'counts', finished=finished) }}
{{ ajax_block(partials, updates_url, 'notifications', finished=finished) }}
{% if template_type == "letter" %}
{% if can_cancel_letter_job %}
<div class="js-stick-at-bottom-when-scrolling">
<div class="page-footer">
<span class="page-footer-delete-link page-footer-delete-link-without-button">
<a href="{{ url_for('main.cancel_letter_job', service_id=current_service.id, job_id=job_id) }}">Cancel sending those letters</a>
{% if can_cancel_letter_job == True %}
<a href="{{ url_for('main.cancel_letter_job', service_id=current_service.id, job_id=job_id) }}">Cancel sending those letters</a>
{% else %}
<p> Can't cancel: {{ can_cancel_letter_job }} </p>
{% endif %}
</span>
{% else %}
<div>&nbsp;</div>