mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 21:13:13 -04:00
Merge pull request #1364 from alphagov/letter-job-page-real
Customise the job page to make sense for letters
This commit is contained in:
@@ -119,25 +119,29 @@
|
||||
|
||||
|
||||
{% macro notification_status_field(notification) %}
|
||||
{% call field(status=notification.status|format_notification_status_as_field_status, align='right') %}
|
||||
{% if notification.status in ['created', 'sending', 'delivered'] %}<span class="align-with-message-body">{% endif %}
|
||||
{% if notification.status|format_notification_status_as_url %}
|
||||
<a href="{{ notification.status|format_notification_status_as_url }}">
|
||||
{% endif %}
|
||||
{{ notification.status|format_notification_status(
|
||||
notification.template.template_type
|
||||
) }}
|
||||
{% if notification.status|format_notification_status_as_url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
<span class="status-hint">
|
||||
{{ notification.status|format_notification_status_as_time(
|
||||
notification.created_at|format_datetime_short,
|
||||
(notification.updated_at or notification.created_at)|format_datetime_short
|
||||
{% if not notification %}
|
||||
{% call field(align='right') %}{% endcall %}
|
||||
{% else %}
|
||||
{% call field(status=notification.status|format_notification_status_as_field_status, align='right') %}
|
||||
{% if notification.status in ['created', 'sending', 'delivered'] %}<span class="align-with-message-body">{% endif %}
|
||||
{% if notification.status|format_notification_status_as_url %}
|
||||
<a href="{{ notification.status|format_notification_status_as_url }}">
|
||||
{% endif %}
|
||||
{{ notification.status|format_notification_status(
|
||||
notification.template.template_type
|
||||
) }}
|
||||
</span>
|
||||
{% if notification.status in ['created', 'sending', 'delivered'] %}</span>{% endif %}
|
||||
{% endcall %}
|
||||
{% if notification.status|format_notification_status_as_url %}
|
||||
</a>
|
||||
{% endif %}
|
||||
<span class="status-hint">
|
||||
{{ notification.status|format_notification_status_as_time(
|
||||
notification.created_at|format_datetime_short,
|
||||
(notification.updated_at or notification.created_at)|format_datetime_short
|
||||
) }}
|
||||
</span>
|
||||
{% if notification.status in ['created', 'sending', 'delivered'] %}</span>{% endif %}
|
||||
{% endcall %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
|
||||
23
app/templates/partials/jobs/count-letters.html
Normal file
23
app/templates/partials/jobs/count-letters.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% from 'components/big-number.html' import big_number %}
|
||||
{% from 'components/message-count-label.html' import message_count_label %}
|
||||
|
||||
<div class="grid-row bottom-gutter-2-3">
|
||||
<div class="column-half">
|
||||
<div class="keyline-block">
|
||||
{{ big_number(
|
||||
total,
|
||||
message_count_label(total, 'letter', suffix='')|capitalize,
|
||||
smaller=True
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column-half">
|
||||
<div class="keyline-block">
|
||||
{{ big_number(
|
||||
delivery_estimate|string|format_date_short,
|
||||
'Estimated delivery date',
|
||||
smaller=True
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -24,16 +24,18 @@
|
||||
<div class="dashboard-table bottom-gutter-3-2">
|
||||
{% endif %}
|
||||
|
||||
{% if percentage_complete < 100 %}
|
||||
<p class="bottom-gutter hint">
|
||||
Report is {{ "{:.0f}%".format(percentage_complete * 0.99) }} complete…
|
||||
</p>
|
||||
{% elif notifications %}
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||
 
|
||||
<span id="time-left">{{ time_left }}</span>
|
||||
</p>
|
||||
{% if template.template_type != 'letter' %}
|
||||
{% if percentage_complete < 100 %}
|
||||
<p class="bottom-gutter hint">
|
||||
Report is {{ "{:.0f}%".format(percentage_complete * 0.99) }} complete…
|
||||
</p>
|
||||
{% elif notifications %}
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ download_link }}" download="download" class="heading-small">Download this report</a>
|
||||
 
|
||||
<span id="time-left">{{ time_left }}</span>
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% call(item, row_number) list_table(
|
||||
@@ -53,7 +55,9 @@
|
||||
{{ item.preview_of_content }}
|
||||
</p>
|
||||
{% endcall %}
|
||||
{{ notification_status_field(item) }}
|
||||
{{ notification_status_field(
|
||||
'' if template.template_type == 'letter' else item
|
||||
) }}
|
||||
{% endcall %}
|
||||
|
||||
{% if more_than_one_page %}
|
||||
|
||||
@@ -13,7 +13,11 @@
|
||||
{{ uploaded_file_name }}
|
||||
</h1>
|
||||
|
||||
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
|
||||
{% if just_sent %}
|
||||
{{ banner('We’ve started printing your letters', type='default', with_tick=True) }}
|
||||
{% else %}
|
||||
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
|
||||
{% endif %}
|
||||
{{ ajax_block(partials, updates_url, 'counts', finished=finished) }}
|
||||
{{ ajax_block(partials, updates_url, 'notifications', finished=finished) }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user