{% extends 'layout.html' %} {% block head %} {% endblock head %} {% block content %}
{% if scope == 'daily' %} {{ base_date.strftime('%Y-%m-%d %A') }} {% elif scope == 'weekly' %} Week of {{ start.strftime('%Y-%m-%d') }} {% elif scope == 'monthly' %} {{ base_date.strftime('%B %Y') }} {% endif %}
{% for hour in range(0, 24, grid) %}
{{ '%02d:00'|format(hour) }}
{% endfor %}
{% for day in days %}
{{ day.strftime('%a %d') if scope != 'daily' else day.strftime('%A') }}
{% for hour in range(0, 24, grid) %}
{% endfor %} {% set day_blocks = [] %} {% for block in blocks %} {% if block.start.date() == day.date() %} {% set _ = day_blocks.append(block) %} {% endif %} {% endfor %} {% set hour_groups = {} %} {% for block in day_blocks %} {% set hour_key = block.hour %} {% if hour_key not in hour_groups %} {% set _ = hour_groups.update({hour_key: []}) %} {% endif %} {% set _ = hour_groups[hour_key].append(block) %} {% endfor %} {% for hour_key, hour_blocks in hour_groups.items() %} {% for block in hour_blocks %} {% set idx = loop.index0 %} {% set base_top_px = block.hour * 60 %} {% set duration_hours = block.duration / 3600.0 %} {% set height_px = duration_hours * 60 %} {% if height_px < 2 %}{% set height_px = 2 %}{% endif %} {% set task_hash = block.task_path|hash if block.task_path else 0 %} {% set base_color_hue = task_hash % 360 %} {% set active_color = 'hsl(%d, 60%%, 45%%)'|format(base_color_hue) %} {% set offset_pct = idx * 8 %} {% set width_pct = 100 - (idx * 8) - 2 %} {% set vertical_offset_px = idx * 4 %} {% set top_px = base_top_px + vertical_offset_px %}
{{ block.task_path }}
{{ (block.duration // 60)|int }}m
{% endfor %} {% endfor %}
{% endfor %}
{% endblock content %}