diff --git a/shiftregister/core/templates/base.html b/shiftregister/core/templates/base.html index deca202..e8930b2 100644 --- a/shiftregister/core/templates/base.html +++ b/shiftregister/core/templates/base.html @@ -31,6 +31,14 @@ margin-bottom: 1em; } + .message-incoming { + margin-right: 20%; + } + + .message-outgoing { + margin-left: 20%; + } + .sticky-nav { background-color: var(--background); margin: 0 -0.75rem; diff --git a/shiftregister/team/forms.py b/shiftregister/team/forms.py index 7faa094..2b7d4ef 100644 --- a/shiftregister/team/forms.py +++ b/shiftregister/team/forms.py @@ -23,3 +23,10 @@ class BulkMessage(forms.Form): checked_in_only = forms.BooleanField( label="Nur an Helfer*innen mit mindestens einem Check-in senden", required=False ) + + +class HelperMessage(forms.Form): + message = forms.CharField( + max_length=160, + widget=forms.Textarea(attrs={"class": "textarea", "placeholder": "Nachricht"}), + ) diff --git a/shiftregister/team/signals.py b/shiftregister/team/signals.py index d9a308b..163784e 100644 --- a/shiftregister/team/signals.py +++ b/shiftregister/team/signals.py @@ -25,9 +25,8 @@ def populate_team_nav(sender, **kwargs): nav_items.append( { "link": reverse("team:incoming_messages"), - "text": "Eingehende Nachrichten" + f" ({num_unread})" - if num_unread - else "", + "text": "Eingehende Nachrichten" + + (f" ({num_unread})" if num_unread else ""), } ) diff --git a/shiftregister/team/templates/helper_detail.html b/shiftregister/team/templates/helper_detail.html index 318878c..103ea72 100644 --- a/shiftregister/team/templates/helper_detail.html +++ b/shiftregister/team/templates/helper_detail.html @@ -1,5 +1,7 @@ {% extends "base.html" %} +{% load humanize %} + {% block title %}Helferdetails{% endblock %} {% block content %} @@ -15,4 +17,43 @@ {% endfor %} +
{{ message.created_at | naturaltime }}
+