Added in notification row number for job pages.

This commit is contained in:
Nicholas Staples
2016-05-20 16:13:01 +01:00
parent d9dda51062
commit 3f404d01b0
2 changed files with 30 additions and 1 deletions

View File

@@ -10,7 +10,33 @@
>
<div>
{% call(item, row_number) list_table(
{% if notifications|length > 0 and notifications[0].job_row_number is not none %}
{% call(item, row_number) list_table(
notifications,
caption=uploaded_file_name,
caption_visible=False,
empty_message="No messages to show yet",
field_headings=[
'1',
'Recipient',
right_aligned_field_heading('Status')
]
) %}
{% call field() %}
{{ item.job_row_number + 2 }}
{% endcall %}
{% call field() %}
{{ item.to }}
{% endcall %}
{% call field(
align='right',
status='error' if item.status == 'Failed' else 'default'
) %}
{{ item.status|format_notification_status }} at {{ item.updated_at|format_time }}
{% endcall %}
{% endcall %}
{% else %}
{% call(item, row_number) list_table(
notifications,
caption=uploaded_file_name,
caption_visible=False,
@@ -30,6 +56,7 @@
{{ item.status|format_notification_status }} at {{ item.updated_at|format_time }}
{% endcall %}
{% endcall %}
{% endif %}
</div>
</div>

View File

@@ -161,6 +161,7 @@ def notification_json(service_id,
to='07123456789',
status='delivered',
sent_at=None,
job_row_number=None,
created_at=None,
updated_at=None,
with_links=False):
@@ -193,6 +194,7 @@ def notification_json(service_id,
'status': status,
'created_at': created_at,
'updated_at': updated_at,
'job_row_number': job_row_number,
'template_version': template['version']
} for i in range(5)],
'total': 5,