Fix overlapping text on tables of notifications

This commit changes the tables of notifications from 3 columns to two
columns. This is so the text has more room, so it doesn’t start
overlapping.

It also makes sure that if the recipient gets really long that it will
be cut off with an ellipsis, rather than overlapping…

I hypothesize that if a notification fails you probably don’t care when
it failed, just that it failed.
This commit is contained in:
Chris Hill-Scott
2016-09-09 12:25:39 +01:00
parent 963decc205
commit 2d7ed4d34f
5 changed files with 27 additions and 16 deletions

View File

@@ -116,6 +116,7 @@ def create_app():
application.add_template_filter(format_date_normal)
application.add_template_filter(format_date_short)
application.add_template_filter(format_notification_status)
application.add_template_filter(format_notification_status_with_time)
application.add_template_filter(format_notification_status_as_field_status)
application.add_template_filter(format_notification_status_as_url)
@@ -281,6 +282,14 @@ def format_notification_status(status, template_type):
}.get(template_type).get(status, status)
def format_notification_status_with_time(status, template_type, when):
return {
'delivered': 'Delivered {}'.format(when),
'sending': 'Sending since {}'.format(when),
'created': 'Sending since {}'.format(when)
}.get(status, format_notification_status(status, template_type))
def format_notification_status_as_field_status(status):
return {
'failed': 'error',