From 929e2b841fac93a43b5cf0cfc33aebfb9f8f140e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 19 Jun 2017 14:36:25 +0100 Subject: [PATCH] Put notification meta above message, remove AJAX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meta info about a notification (who sent it, when they sent it) won’t ever change, so there’s no need for it to reload it using AJAX. Putting it above the message and under the `

` makes it match how this information is displayed on the job page. On the job page this information is bold, but visually the job page is using too much bold now (nothing is emphasised/differentiated if everything is bold). So this commit also makes this line of info regular on both the notification and job pages. --- app/main/views/notifications.py | 2 ++ app/templates/partials/jobs/status.html | 2 +- app/templates/views/notifications/notification.html | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/main/views/notifications.py b/app/main/views/notifications.py index f7351249f..c501eb0b1 100644 --- a/app/main/views/notifications.py +++ b/app/main/views/notifications.py @@ -70,6 +70,8 @@ def view_notification(service_id, notification_id): help=get_help_argument() ), partials=get_single_notification_partials(notification), + created_by=notification.get('created_by'), + created_at=notification['created_at'], help=get_help_argument() ) diff --git a/app/templates/partials/jobs/status.html b/app/templates/partials/jobs/status.html index c66bc6427..c243ce572 100644 --- a/app/templates/partials/jobs/status.html +++ b/app/templates/partials/jobs/status.html @@ -1,5 +1,5 @@
-

+

{% if job.scheduled_for %} {% if job.processing_started %} Sent by {{ job.created_by.name }} on {{ job.processing_started|format_datetime_short }} diff --git a/app/templates/views/notifications/notification.html b/app/templates/views/notifications/notification.html index 5d17f2f2a..e077877fa 100644 --- a/app/templates/views/notifications/notification.html +++ b/app/templates/views/notifications/notification.html @@ -14,6 +14,11 @@ {{ message_count_label(1, template.template_type, suffix='') | capitalize }}

+

+ Sent {% if created_by %}by {{ created_by.name }} {% endif %} + on {{ created_at|format_datetime_short }} +

+ {{ template|string }} {{ ajax_block(partials, updates_url, 'status', finished=finished) }}