From 33d33cfbab246aa3667426325853cf556a1216d6 Mon Sep 17 00:00:00 2001
From: "Andreas (@xAndy) Zimmermann"
Date: Thu, 18 May 2023 00:50:32 +0200
Subject: [PATCH] show shift actions above and below description texts if there
is a wall of text
---
.../partials/shift_detail_buttons.html | 18 +++++++++++++++
shiftregister/app/templates/shift.html | 22 ++++---------------
2 files changed, 22 insertions(+), 18 deletions(-)
create mode 100644 shiftregister/app/templates/partials/shift_detail_buttons.html
diff --git a/shiftregister/app/templates/partials/shift_detail_buttons.html b/shiftregister/app/templates/partials/shift_detail_buttons.html
new file mode 100644
index 0000000..8d784e7
--- /dev/null
+++ b/shiftregister/app/templates/partials/shift_detail_buttons.html
@@ -0,0 +1,18 @@
+{% if can_register and not shift.deleted %}
+
+{% endif %}
+{% if is_registered and not shift.deleted %}
+{% if can_cancel %}
+
+{% elif not shift.has_ended %}
+ Bitte wende dich an den Infopoint, falls du es nicht zu deiner Schicht schaffst.
+{% endif %}
+{% endif %}
diff --git a/shiftregister/app/templates/shift.html b/shiftregister/app/templates/shift.html
index 3598c19..236f74b 100644
--- a/shiftregister/app/templates/shift.html
+++ b/shiftregister/app/templates/shift.html
@@ -23,6 +23,9 @@
Treffpunkt: {{ shift.room.meeting_location|linebreaksbr }}
Belegung: {{ shift.registration_count }}/{{ shift.required_helpers|default:shift.room.required_helpers }}
+ {% if shift.room.description|length > 100 or shift.description|length > 100 %}
+ {% include 'partials/shift_detail_buttons.html'%}
+ {% endif %}
{% if shift.room.description %}
Beschreibung:
@@ -36,23 +39,6 @@
{% endif %}
-{% if can_register and not shift.deleted %}
-
-{% endif %}
-{% if is_registered and not shift.deleted %}
-{% if can_cancel %}
-
-{% elif not shift.has_ended %}
- Bitte wende dich an den Infopoint, falls du es nicht zu deiner Schicht schaffst.
-{% endif %}
-{% endif %}
+{% include 'partials/shift_detail_buttons.html'%}
{% endblock %}