mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 03:58:25 -04:00
Refactor to make it logic clearer
The logic around what gets shown on the uploads page was hard to follow. This commit makes three changes to hopefully make it easier: - remove the passing-around of a string containing the contents of a rendered partial - encapsulate everything in one `show_scheduled_jobs` variable, rather than mixing between `scheduled_jobs` and `current_service.scheduled_jobs` - adds a comment to explain why we still render `_jobs.html` even when we know we have no jobs
This commit is contained in:
@@ -9,8 +9,19 @@
|
||||
{% block maincolumn_content %}
|
||||
<h1 class="heading-large">Uploads</h1>
|
||||
<div class="dashboard">
|
||||
{{ scheduled_jobs|safe }}
|
||||
{% if jobs or not current_service.scheduled_jobs %}
|
||||
{% if show_scheduled_jobs %}
|
||||
{% with hide_heading = True %}
|
||||
{% include 'views/dashboard/_upcoming.html' %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
{% if jobs %}
|
||||
{% include 'views/dashboard/_jobs.html' %}
|
||||
{% endif %}
|
||||
{% if not jobs and not show_scheduled_jobs %}
|
||||
{#
|
||||
`_jobs.html` will show the ‘You have no jobs’ message when
|
||||
passed an empty list of jobs
|
||||
#}
|
||||
{% include 'views/dashboard/_jobs.html' %}
|
||||
{% endif %}
|
||||
{{ previous_next_navigation(prev_page, next_page) }}
|
||||
|
||||
Reference in New Issue
Block a user