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 %} +
+ {% csrf_token %} + {{ shift_form.as_p }} + +
+{% endif %} +{% if is_registered and not shift.deleted %} +{% if can_cancel %} +
+ {% csrf_token %} + {{ shift_form.as_p }} + +
+{% 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 %} -
- {% csrf_token %} - {{ shift_form.as_p }} - -
-{% endif %} -{% if is_registered and not shift.deleted %} -{% if can_cancel %} -
- {% csrf_token %} - {{ shift_form.as_p }} - -
-{% 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 %}