diff --git a/djangorota/djangorota/templates/rota/worker_detail.html b/djangorota/djangorota/templates/rota/worker_detail.html index 1123ff1..c81f236 100644 --- a/djangorota/djangorota/templates/rota/worker_detail.html +++ b/djangorota/djangorota/templates/rota/worker_detail.html @@ -1,68 +1,62 @@ +{% extends 'base.html' %} {% load crispy_forms_tags static %} - - - {{ worker.name }} - - - {% include 'rota/partials/flatpickr_includes.html' %} - - - -
-
-
-

Request leave on calendar

-
-

Select a date or drag to select a range to request leave.

-
-

{{ worker.name }}

-

{{ worker.email }} - {{ worker.site }}

+{% block content %} +
+

Request leave for {{ worker.name }}

- {# Navigation: back to an assigned rota (show first assigned rota if any) #} - {% with back_rota=worker.rotas.all.0 %} - {% if back_rota %} -

← Back to rota: {{ back_rota.name }}

- {% endif %} - {% endwith %} - -
-

Request leave

-
- {% csrf_token %} - {{ form|crispy }} -
-
- -
-
-
-
- -

Existing leave

-
- {# Delete-all control: only show to staff or the worker themselves #} - {% if request.user.is_staff or request.user.is_authenticated and request.user.email and request.user.email == worker.email %} -
- {% csrf_token %} - -
- {% endif %} - {% include 'rota/partials/leave_list.html' with leaves=worker.leaves.all %} -
+
+

Request leave on calendar

+ {% include 'rota/partials/flatpickr_includes.html' %} + +
+

Click a start date then a second date to select a range and prefill the leave form.

-
- - - - + + {% with back_rota=worker.rotas.all.0 %} + {% if back_rota %} +

← Back to rota: {{ back_rota.name }}

+ {% endif %} + {% endwith %} + +
+ {% csrf_token %} + {{ form|crispy }} +
+
+ +
+
+
+ +

Existing leave for {{ worker.name }}

+
+ {% if request.user.is_staff or request.user.is_authenticated and request.user.email and request.user.email == worker.email %} +
+ {% csrf_token %} + +
+ {% endif %} + {% include 'rota/partials/leave_list.html' with leaves=worker.leaves.all %} +
+ +
+ Legend: + Existing leave + Selected range +
+ + + + +{% endblock %}