{% extends "management/base.html" %} {% load i18n lucide ui %} {% block heading %}{% trans "Events" %}{% endblock heading %} {% block actions %} {% if is_club_admin and rbihf_enabled %} {% lucide "download" size=16 %} {% trans "Import from RBIHF" %} {% endif %} {% if can_create %} {% lucide "repeat" size=16 %} {% trans "New series" %} {% lucide "plus" size=16 %} {% trans "New event" %} {% endif %} {% endblock actions %} {% block filter_strip %}
{% if view_mode != "calendar" %}{% endif %} {% if calendar_range != "week" %}{% endif %} {% if view_mode == "calendar" and calendar_range != "season" %}{% endif %} {% if view_mode == "list" %} {% endif %}
{% if view_mode == "calendar" %}
{% trans "Week" %} {% trans "Month" %} {% trans "Season" %}
{% if calendar_range != "season" %}
{% lucide "chevron-left" size=14 %} {% trans "Today" %} {% lucide "chevron-right" size=14 %}
{% endif %} {% endif %} {# Calendar/List segmented toggle -- member_list.html's Members/Guardians/Both pattern. #}
{% lucide "calendar" size=13 %} {% trans "Calendar" %} {% lucide "list" size=13 %} {% trans "List" %}
{% endblock filter_strip %} {% block panel %} {% if view_mode == "list" %} {% if not events %}
{% trans "No events." %}
{% else %}
{% if list_this_week %}
{% trans "This week" %}
{% for event in list_this_week %}{% include "management/_event_list_row.html" %}{% endfor %}
{% endif %} {% if list_next_week %}
{% trans "Next week" %}
{% for event in list_next_week %}{% include "management/_event_list_row.html" %}{% endfor %}
{% endif %} {% for month in list_months %}
{{ month.month_start|date:"F Y" }}
{% for event in month.items %}{% include "management/_event_list_row.html" %}{% endfor %}
{% endfor %}
{% endif %} {% include "management/_pagination.html" %} {% comment %} Dialogs live outside the table: may only contain elements. {% endcomment %} {% for event in events %} {% if event.can_manage %} {% endif %} {% endfor %} {% elif calendar_range == "week" %}
{% blocktrans with start=calendar.week_start|date:"j M" end=calendar.week_end|date:"j M Y" %}{{ start }} – {{ end }}{% endblocktrans %}
{% comment %} Deliberately its own bounded, contained scroll (max-h + overflow-y-auto) rather than riding the page's own scroll like everywhere else in this app (management/base.html's own comment) -- the grid always spans the full 24h day (never clipped, see DEFAULT_DAY_START_HOUR/END_HOUR's own comment), so inlining all of it into the page would mean scrolling past a screenful of empty small-hours before reaching any events most weeks. extra_body's own script scrolls this container to just before the week's first event on load, for the same reason. {% endcomment %}
{% with hours_span=calendar.hours|length|add:"-1" %}
{% for day in calendar.days %}
{{ day.date|date:"D" }} {{ day.date|date:"j" }}
{% endfor %}
{% for hour in calendar.hours %} {{ hour|stringformat:"02d" }}:00 {% endfor %}
{% for day in calendar.days %} {% endfor %}
{% endwith %}
{% elif calendar_range == "month" %}
{{ anchor|date:"F Y" }}
{% for cell in calendar.weeks.0 %}
{{ cell.date|date:"D" }}
{% endfor %}
{% for week in calendar.weeks %} {% for cell in week %}
{{ cell.date|date:"j" }}
{% for event in cell.events|slice:":3" %} {{ event.title }} {% if event.series_id %}{% lucide "repeat" size=10 %}{% endif %} {% endfor %} {% if cell.events|length > 3 %} {% with extra_count=cell.events|length|add:"-3" %} {% blocktrans count counter=extra_count %}+{{ counter }} more{% plural %}+{{ counter }} more{% endblocktrans %} {% endwith %} {% endif %}
{% endfor %} {% endfor %}
{% elif calendar_range == "season" %} {% if not calendar %}
{% lucide "calendar-x" size=20 %} {% trans "Pick a season above to see its calendar." %}
{% else %}
{% for month in calendar.months %}
{{ month.label|date:"F Y" }}
{% for cell in month.weeks.0 %} {{ cell.date|date:"D"|slice:":1" }} {% endfor %}
{% for week in month.weeks %} {% for cell in week %} {% if cell.count %} {{ cell.date|date:"j" }} {{ cell.count }} {% else %} {{ cell.date|date:"j" }} {% endif %} {% endfor %} {% endfor %}
{% empty %}

{% trans "This season has no months to show." %}

{% endfor %}
{% endif %} {% endif %} {% endblock panel %} {% block extra_body %} {% if calendar_range == "week" %} {% endif %} {% endblock extra_body %}