{# Context: month (one month of the yearly grid), calendar, cal_options #} {% if "monthly" in cal_options.views %} {% url 'htmx_calendar:monthly' calendar_slug=calendar.slug year=month.year month=month.month as month_url %} {% endif %}

{% if month_url %} {% else %} {{ month.name }} {% endif %}

{% for weekday in WEEKDAYS_ABBR %}
{{ weekday|slice:":1" }}
{% endfor %}
{% for day in month.days %} {# A day opens the most detailed view offered: the day, its week or its month. #} {% if "daily" in cal_options.views %} {% url 'htmx_calendar:daily' calendar_slug=calendar.slug year=day.date.year month=day.date.month day=day.date.day as day_url %} {% elif "weekly" in cal_options.views %} {% url 'htmx_calendar:weekly' calendar_slug=calendar.slug year=day.date|date:"o" week=day.date|date:"W" as day_url %} {% elif "monthly" in cal_options.views %} {% url 'htmx_calendar:monthly' calendar_slug=calendar.slug year=day.date.year month=day.date.month as day_url %} {% endif %} {# The dot and the tint mark days of this month only: the others are marked in their own month. #} {% endfor %}