2
0
Fork 0

unify checkin messaging

This commit is contained in:
Andreas (@xAndy) Zimmermann 2022-05-17 17:11:23 +02:00
parent f70e94955d
commit af3d9381ad
4 changed files with 24 additions and 3 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.0.4 on 2022-05-17 15:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("app", "0009_helper_asta_confirmed"),
]
operations = [
migrations.AddField(
model_name="room",
name="meeting_location",
field=models.TextField(default="Infopoint"),
),
]

View File

@ -13,6 +13,7 @@ global_preferences = global_preferences_registry.manager()
class Room(models.Model): class Room(models.Model):
name = models.CharField(max_length=200, primary_key=True) name = models.CharField(max_length=200, primary_key=True)
required_helpers = models.IntegerField() required_helpers = models.IntegerField()
meeting_location = models.TextField(default="Infopoint")
def __str__(self): def __str__(self):
return self.name return self.name
@ -135,7 +136,8 @@ class ShiftRegistration(models.Model):
) )
def send_reminder(self): def send_reminder(self):
text = f"Deine kontakt-Schicht beginnt um {self.shift.start_at.strftime('%H:%M')}, bitte komm eine halbe Stunde vorher an den Infopoint." url = reverse("shift", kwargs={"shiftid": self.shift.pk})
text = f"Deine kontakt-Schicht beginnt um {self.shift.start_at.strftime('%H:%M')}, bitte komm 15 Minuten vorher an den Treffpunkt. https://kontakt.rocks{url}"
msg = Message(to=self.helper, text=text) msg = Message(to=self.helper, text=text)
msg.save() msg.save()
self.reminder_sent = True self.reminder_sent = True

View File

@ -5,7 +5,7 @@
{% block content %} {% block content %}
<div class="box"> <div class="box">
{% if is_registered %} {% if is_registered %}
<div class="notification is-info">Du bist zu dieser Schicht angemeldet</div> <div class="notification is-info">Du bist zu dieser Schicht angemeldet. Bitte komme 15 Minuten vor deiner Schicht am Treffpunkt.</div>
{% endif %} {% endif %}
{% if shift.deleted %} {% if shift.deleted %}
<div class="notification">Diese Schicht wurde gelöscht.</div> <div class="notification">Diese Schicht wurde gelöscht.</div>
@ -17,6 +17,7 @@
<strong>Ort:</strong> {{ shift.room.name }}<br> <strong>Ort:</strong> {{ shift.room.name }}<br>
<strong>Beginn:</strong> {{ shift.start_at }}<br> <strong>Beginn:</strong> {{ shift.start_at }}<br>
<strong>Dauer:</strong> {{ shift.duration }}<br> <strong>Dauer:</strong> {{ shift.duration }}<br>
<strong>Treffpunkt:</strong> {{ shift.room.meeting_location }}<br>
<em>{{ shift.description|linebreaksbr }}</em> <em>{{ shift.description|linebreaksbr }}</em>
</div> </div>
{% if can_register and not shift.deleted %} {% if can_register and not shift.deleted %}

View File

@ -216,7 +216,7 @@ def shift(request, shiftid):
messages.add_message( messages.add_message(
request, request,
messages.SUCCESS, messages.SUCCESS,
"Erfolgreich angemeldet, bitte komme eine halbe Stunde vor deiner Schicht an den Infopoint", "Erfolgreich angemeldet, bitte komme 15 Minuten vor deiner Schicht am Treffpunkt",
) )
# redirect so page can be reloaded without resending post data # redirect so page can be reloaded without resending post data
return redirect("shift", shiftid=shift.pk) return redirect("shift", shiftid=shift.pk)