{% extends 'base.html' %} {% load crispy_forms_tags static %} {% block content %}

Request leave for {{ worker.name }}

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 %}