From 04ef730fd191507b513d32d2601929eacc1c8e8d Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Thu, 9 Jun 2016 11:26:45 +0100 Subject: [PATCH] Remove redundant `if` statement on job page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We had this if statement to lay out the table differently with and without row numbers. Since we don’t show row numbers at all, this isn’t needed. --- .../partials/jobs/notifications.html | 73 ++++++------------- 1 file changed, 24 insertions(+), 49 deletions(-) diff --git a/app/templates/partials/jobs/notifications.html b/app/templates/partials/jobs/notifications.html index 9241aa83f..cb87d6280 100644 --- a/app/templates/partials/jobs/notifications.html +++ b/app/templates/partials/jobs/notifications.html @@ -9,55 +9,30 @@ {% endif %} > -
- {% 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=[ - 'Recipient', - 'Time', - right_aligned_field_heading('Status') - ], - field_headings_visible=False - ) %} - {% call row_heading() %} - {{ item.to }} - {% endcall %} - {{ date_field( - (item.updated_at or item.created_at)|format_datetime_short - ) }} - {% call field( - align='right', - status=item.status|format_notification_status_as_field_status - ) %} - {{ item.status|format_notification_status(item.template.template_type) }} - {% endcall %} - {% endcall %} - {% else %} - {% call(item, row_number) list_table( - notifications, - caption=uploaded_file_name, - caption_visible=False, - empty_message="No messages to show yet", - field_headings=[ - 'Recipient', - right_aligned_field_heading('Status') - ] - ) %} - {% 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 %} + {% call(item, row_number) list_table( + notifications, + caption=uploaded_file_name, + caption_visible=False, + empty_message="No messages to show yet", + field_headings=[ + 'Recipient', + 'Time', + 'Status' + ], + field_headings_visible=False + ) %} + {% call row_heading() %} + {{ item.to }} {% endcall %} - {% endif %} -
+ {{ date_field( + (item.updated_at or item.created_at)|format_datetime_short + ) }} + {% call field( + align='right', + status=item.status|format_notification_status_as_field_status + ) %} + {{ item.status|format_notification_status(item.template.template_type) }} + {% endcall %} + {% endcall %}