Content changes for notification pages

This commit adds content pages for the notifications pages, particularly
the letter pages, which will make things clearer now that we will soon be allowing
letters to be cancelled.

The main changes are:
* The confirmation banner for letters sent from a CSV file now states when
printing will start.
* We state the CSV file that notifications were sent from on the
notifications page
* The notification page for letters shows when printing starts (today,
tomorrow, or that date that the letter was printed)
This commit is contained in:
Katie Smith
2018-11-27 16:49:01 +00:00
parent 07a1d903eb
commit 088d6ee4b0
8 changed files with 166 additions and 22 deletions

View File

@@ -2,7 +2,7 @@ import csv
import os
import re
import unicodedata
from datetime import datetime, timedelta, timezone
from datetime import datetime, time, timedelta, timezone
from functools import wraps
from io import StringIO
from itertools import chain
@@ -33,6 +33,7 @@ from notifications_utils.template import (
LetterPreviewTemplate,
SMSPreviewTemplate,
)
from notifications_utils.timezones import convert_utc_to_bst
from orderedset._orderedset import OrderedSet
from werkzeug.datastructures import MultiDict
@@ -643,3 +644,13 @@ def get_default_sms_sender(sms_senders):
Field(x['sms_sender'], html='escape')
for x in sms_senders if x['is_default']
), "None"))
def printing_today_or_tomorrow():
now_utc = datetime.utcnow()
now_bst = convert_utc_to_bst(now_utc)
if now_bst.time() < time(17, 30):
return 'today'
else:
return 'tomorrow'