From 3e2b9f649c4a88f3cc6eacbfce188e5d4e81235c Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 16 Dec 2024 08:31:38 +0100 Subject: [PATCH] moved and updated e-mail msg templates --- src/server/BreCal/database/enums.py | 9 +---- src/server/BreCal/msg/msg_types.json | 37 +++++++++++++++++++ .../BreCal/msg}/notification_element.html | 4 +- .../BreCal/msg}/notification_template.html | 16 +++++--- src/server/BreCal/schemas/model.py | 9 +++-- 5 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 src/server/BreCal/msg/msg_types.json rename {misc => src/server/BreCal/msg}/notification_element.html (63%) rename {misc => src/server/BreCal/msg}/notification_template.html (97%) diff --git a/src/server/BreCal/database/enums.py b/src/server/BreCal/database/enums.py index 372b760..6dfefe2 100644 --- a/src/server/BreCal/database/enums.py +++ b/src/server/BreCal/database/enums.py @@ -47,17 +47,10 @@ class PierSide(IntEnum): """These enumerators determine the pier side of a shipcall.""" PORTSIDE = 0 # Port/Backbord STARBOARD_SIDE = 1 # Starboard / Steuerbord - -class NotificationType(IntFlag): - """determines the method by which a notification is distributed to users. Flagging allows selecting multiple notification types.""" - UNDEFINED = 0 - EMAIL = 1 - POPUP = 2 - MESSENGER = 4 class ParticipantFlag(IntFlag): """ - | 1 | If this flag is set on a shipcall record with participant type Agency (8), + | 1 | If this flag is set on a shipcall record with participant type Agency (8), all participants of type BSMD (1) may edit the record. """ undefined = 0 diff --git a/src/server/BreCal/msg/msg_types.json b/src/server/BreCal/msg/msg_types.json new file mode 100644 index 0000000..a4bdd04 --- /dev/null +++ b/src/server/BreCal/msg/msg_types.json @@ -0,0 +1,37 @@ +[ + { + "type" : 1, + "color" : "#0867ec", + "name" : "assignment", + "link" : "https://www.bremen-calling.de/", + "msg_text" : "Nominierung" + }, + { + "type" : 2, + "color" : "#ea5c00", + "name" : "next24h", + "link" : "https://www.bremen-calling.de/", + "msg_text" : "Morgenrunde relevant" + }, + { + "type" : 3, + "color" : "#f34336", + "name" : "time_conflict", + "link" : "https://www.bremen-calling.de/", + "msg_text" : "Zeitlicher Konflikt" + }, + { + "type" : 4, + "color" : "#28b532", + "name" : "time_conflict_resolved", + "link" : "https://www.bremen-calling.de/", + "msg_text" : "Zeitlicher Konflikt gelöst" + }, + { + "type" : 5, + "color" : "#f8f8f8", + "name" : "unassigned", + "link" : "https://www.bremen-calling.de/", + "msg_text" : "Nominierung abgewählt" + } +] \ No newline at end of file diff --git a/misc/notification_element.html b/src/server/BreCal/msg/notification_element.html similarity index 63% rename from misc/notification_element.html rename to src/server/BreCal/msg/notification_element.html index 154cf8b..6a69d76 100644 --- a/misc/notification_element.html +++ b/src/server/BreCal/msg/notification_element.html @@ -5,7 +5,9 @@ - +
Call To Action + [[text]] +
diff --git a/misc/notification_template.html b/src/server/BreCal/msg/notification_template.html similarity index 97% rename from misc/notification_template.html rename to src/server/BreCal/msg/notification_template.html index 61af32b..dbc5e11 100644 --- a/misc/notification_template.html +++ b/src/server/BreCal/msg/notification_template.html @@ -103,10 +103,14 @@

Hallo,

Sie erhalten eine oder mehrere Benachrichtigungen von Bremen calling:

- - - -

Wenn Sie diese E-Mails nicht länger erhalten wollen, loggen Sie sich bitte in der Bremen Calling App ein. Im Bereich "Passwort ändern" + + + + [[NOTIFICATION_ELEMENTS]] + + + +

Wenn Sie diese E-Mails nicht länger erhalten wollen, loggen Sie sich bitte in der Bremen Calling App ein. Im Bereich "Passwort ändern" können Sie auch die Benachrichtungen anpassen.

@@ -120,7 +124,7 @@ @@ -134,7 +138,7 @@ - + diff --git a/src/server/BreCal/schemas/model.py b/src/server/BreCal/schemas/model.py index 5f07741..0d36fc8 100644 --- a/src/server/BreCal/schemas/model.py +++ b/src/server/BreCal/schemas/model.py @@ -71,10 +71,11 @@ class NotificationType(IntEnum): It can be understood as an event type """ - assignment = 0 - next24h = 1 - time_conflict = 2 - time_conflict_resolved = 3 + assignment = 1 + next24h = 2 + time_conflict = 3 + time_conflict_resolved = 4 + unassigned = 5 @classmethod def _missing_(cls, value):
- Bremer Schiffsmeldedienst GbR - Hafenkopf II / Überseetor 20 - 28217 Bremen / Germany + Bremer Schiffsmeldedienst GbR - Hafenkopf II / Überseetor 20 - 28217 Bremen / Germany