Make a job model for individual jobs

This follows the pattern of what we’ve done with services, users and
events.

It gives us a better interface to the data we get back from the API than
dealing with the raw JSON directly.

Now is a good time to do this because we’re going to be making a bunch
of changes to the jobs pages, and those changes will be easier to code
and understand with a sesnsible model behind them.
This commit is contained in:
Chris Hill-Scott
2020-01-08 12:23:09 +00:00
parent c391729dc0
commit 5e7ec3e30d
8 changed files with 224 additions and 119 deletions

View File

@@ -4,13 +4,13 @@
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
{{ uploaded_file_name }}
{{ job.original_file_name }}
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{{ uploaded_file_name }}
{{ job.original_file_name }}
</h1>
{% if just_sent %}
@@ -21,11 +21,11 @@
{{ ajax_block(partials, updates_url, 'counts', finished=finished) }}
{{ ajax_block(partials, updates_url, 'notifications', finished=finished) }}
{% if can_cancel_letter_job %}
{% if job.letter_job_can_be_cancelled %}
<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 these letters</a>
<a href="{{ url_for('main.cancel_letter_job', service_id=current_service.id, job_id=job.id) }}">Cancel sending these letters</a>
</span>
{% else %}
<div>&nbsp;</div>