diff --git a/manage.py b/manage.py
index f521389..34c8a7e 100755
--- a/manage.py
+++ b/manage.py
@@ -6,7 +6,7 @@ import sys
def main():
"""Run administrative tasks."""
- os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shiftregister.settings')
+ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shiftregister.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
@@ -18,5 +18,5 @@ def main():
execute_from_command_line(sys.argv)
-if __name__ == '__main__':
+if __name__ == "__main__":
main()
diff --git a/shiftregister/app/admin.py b/shiftregister/app/admin.py
index 564b7ee..a0a3037 100644
--- a/shiftregister/app/admin.py
+++ b/shiftregister/app/admin.py
@@ -7,7 +7,7 @@ admin.site.register(Room)
@admin.register(Shift)
class ShiftAdmin(admin.ModelAdmin):
- list_display = ("room_name", "start_at", "free_slots", "deleted")
+ list_display = ("room_name", "description", "start_at", "free_slots", "deleted")
def room_name(self, object):
return object.room.name
diff --git a/shiftregister/app/migrations/0011_room_description.py b/shiftregister/app/migrations/0011_room_description.py
new file mode 100644
index 0000000..e6abba8
--- /dev/null
+++ b/shiftregister/app/migrations/0011_room_description.py
@@ -0,0 +1,18 @@
+# Generated by Django 4.0.4 on 2022-05-21 16:31
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("app", "0010_room_meeting_location"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="room",
+ name="description",
+ field=models.TextField(blank=True, default=""),
+ ),
+ ]
diff --git a/shiftregister/app/models.py b/shiftregister/app/models.py
index ba248c2..f87fe79 100644
--- a/shiftregister/app/models.py
+++ b/shiftregister/app/models.py
@@ -15,6 +15,7 @@ class Room(models.Model):
name = models.CharField(max_length=200, primary_key=True)
required_helpers = models.IntegerField()
meeting_location = models.TextField(default="Infopoint")
+ description = models.TextField(blank=True, default="")
def __str__(self):
return self.name
diff --git a/shiftregister/app/templates/shift.html b/shiftregister/app/templates/shift.html
index 813e812..7d81140 100644
--- a/shiftregister/app/templates/shift.html
+++ b/shiftregister/app/templates/shift.html
@@ -14,11 +14,20 @@
Diese Schicht ist bereits besetzt.
{% endif %}
-
Ort: {{ shift.room.name }} 📍
-
Beginn: {{ shift.start_at }}
-
Dauer: {{ shift.duration }}
-
Treffpunkt: {{ shift.room.meeting_location|linebreaksbr }}
-
{{ shift.description|linebreaksbr }}
+
+ Ort: {{ shift.room.name }} 📍
+ Beginn: {{ shift.start_at }}
+ Dauer: {{ shift.duration }}
+ Treffpunkt: {{ shift.room.meeting_location|linebreaksbr }}
+
+ {% if shift.room.description %}
+
Beschreibung:
+
{{ shift.room.description|linebreaksbr }}
+ {% endif %}
+ {% if shift.description %}
+
Zusatzinfo:
+
{{ shift.description|linebreaksbr }}
+ {% endif %}
{% if can_register and not shift.deleted %}