{% load i18n %} {% comment %} calendar_grid.html — CSS Grid-based scheduling calendar. Context: calendar — CalendarGridData instance (codex_django.cabinet.types.CalendarGridData) Layout: Columns = calendar.cols (masters, rooms, days — anything) Rows = calendar.rows (time slots — "8:00", "8:30", ...) Events = calendar.events (CalendarSlot: col, row, span, title, color, url) Backend computes col/row/span; template only renders. Click on empty slot → HTMX GET new_event_url?col=N&row=N → opens modal. Click on event → HTMX GET event.url → opens modal. Usage: {% include "cabinet/components/calendar_grid.html" with calendar=calendar %} {% include "cabinet/includes/_modal_base.html" %} {% endcomment %} {% with col_count=calendar.cols|length row_count=calendar.rows|length %}