{% load cal_tags %}
{% cal_include "header_section" mode=view_mode %}
{# Events of a day or more, sticky so they stay while the hours scroll #} {% if allday_bars %}
{% cal_include "allday_row" gutter_on_phone=True %}
{% endif %}
{# Stacked time-grid: background lines/labels + foreground events #}
{# --- The day column, under the lines: tinted when it holds an unavailable event --- #} {# --- Horizontal lines + hour labels (background layer) --- #}
{# Header spacer row (matches the 1.75rem header in grid-template-rows) #}
{# One row per slot in the visible window #} {% for label in timegrid_slot_labels %}
{% if label %}
{{ label }}
{% endif %}
{% endfor %}
{# --- Events overlay (foreground layer) --- #}
    {# Overlapping events share their cluster's width; the others take the whole column. #} {% for cluster in days.0.timegrid_clusters %}
  1. {% for ev in cluster.events %}{% cal_include "timegrid_event" %}{% endfor %}
  2. {% endfor %}