{% from "components/_badge.html" import badge %} {# The heading is the title alone; the count and the summary sit beside and under it, so neither becomes part of its name. In a collapsed column it is a 's content, which must be phrasing: hence ``tag``. #} {% macro column_heading(column, col, tag=none) %} <{{ tag or "div" }} class="kanban-column-heading">

{{ column.title }}

{%- if column.count_label %}{{ column.count_label }} {%- else %}{{ col.count_text }} {%- endif %} {% if column.summary %}<{{ tag or "p" }} class="kanban-column-summary">{{ column.summary }}{% endif %} {% endmacro %} {# Kanban board component (KanbanComponent in components.py; docs in manual/kanban.org). The no-JS move/quick-add forms are the baseline and stay rendered as the keyboard path; kanban-dnd.js layers drag-and-drop on the same markup and posts to the same place endpoint. #} {% if live_attrs %} {# Content sink required by the live client; the watch stream's only job is the reload-triggering done event. #} {% endif %} {# The strip scrolls sideways when the columns do not fit: a focusable region so it scrolls by keyboard too, with edge shadows (CSS) saying that more is off to a side. #}
{% for col in column_data %} {% set column = col.column %} {% if col.collapsed %} {# collapse_empty: an empty column is a narrow strip (the title on its side) that opens into the full column. Its card zone stays in the markup, so it is still a drop target; the drag layer opens it when a card is dragged over it. #}
{{ column_heading(column, col, "span") }} {% else %}
{{ column_heading(column, col) }}
{% endif %}
{% for kind, payload in col.entries %} {% if kind == "slot" %}
{{ csrf_field }}
{% else %} {% set card = payload.card %} {% set is_moving = moving and card.id == moving.id %} {% set has_grip = place_url and not moving %} {% set has_close = card.close_action and not moving %}
{# The grip is both the no-JS move entry point and, in JS mode, the drag handle (starting a drag never fires the click). It sits in the card's top-left corner, opposite the close ×, so it adds no height; the cancel link of the card being moved stays a full strip, since it needs its words. #} {% if place_url %} {% if is_moving %} {{ t.move_cancel }} {% elif not moving %} {% endif %} {% endif %} {% if card.close_action and not moving %}
{{ csrf_field }} {% for fname, fval in card.close_action.fields.items() %} {% endfor %}
{% endif %}
{% if card.url %}{{ card.title }} {% else %}{{ card.title }}{% endif %}
{% if card.subtitle %}

{%- if card.subtitle_url %}{{ card.subtitle }} {%- else %}{{ card.subtitle }}{% endif %}

{% endif %} {% if payload.badges %}
{% for b in payload.badges %}{{ badge(b.text, b.tone, icon_name=b.icon, css_class="kanban-badge") }}{% endfor %}
{% endif %} {% if payload.meta %}
{% for entry in payload.meta %} {%- if entry.icon %}{{ icon(entry.icon, size="sm", cls="kanban-meta__icon") }}{% endif %}{{ entry.text }} {% endfor %}
{% endif %} {% if card.people %}
{% for entry in card.people %} {% if entry is string %}{{ entry }} {% elif entry.name is defined %} {{ entry.name }} {% else %}{{ entry[0] }}{% endif %} {% endfor %}
{% endif %} {% if card.actions and not moving %}
{% for action in card.actions %}
{{ csrf_field }} {% for fname, fval in action.fields.items() %} {% endfor %}
{% endfor %}
{% endif %}
{% endif %} {% else %}

—

{% endfor %}
{% if col.quick_add and not moving %} {% set disclosure = c.quick_add_style == "disclosure" %} {% if disclosure %} {# quick_add_style="disclosure": a "+ Add" button that opens the field; without JS a plain
. The drag layer's script moves focus into the field when it opens. #}
+ {{ t.add_label }} {% endif %} {% set described = [] %} {% if c.add_help %}{% set _ = described.append(col.add_id ~ "-help") %}{% endif %} {% if column.add_error %}{% set _ = described.append(col.add_id ~ "-error") %}{% endif %}
{{ csrf_field }}
{% if c.add_help %} {{ c.add_help }} {% endif %} {% if column.add_error %} {{ icon("cancel", label=t.error_prefix) }} {{ column.add_error }} {% endif %}
{% if disclosure %}
{% endif %} {% endif %} {% if col.collapsed %}
{% else %}
{% endif %} {% endfor %}