mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-18 13:39:57 -04:00
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:
13
app/utils.py
13
app/utils.py
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user