{# ── Item card component ── Variables: item, view ("kanban"|"list"), project_key, project, kind_color(), kind_label(), status_color(), status_label() #} {% set kc = kind_color(item.kind) %} {% set sc = status_color(item.status) %} {% if view == "kanban" %} {# ── Kanban card ── #}
{# Top row: kind badge + ID #}
{{ kind_label(item.kind, project) }} {{ item.local_id }}
{# Title #} {{ item.title }} {% if item.custom_fields %}
{% for field_key, field_cfg in project.custom_fields.items() %} {% set field_value = item.custom_fields.get(field_key) %} {% if field_value is sameas true %} {{ field_cfg.label }}: {{ t("custom_fields.true") }} {% elif field_value is not none and field_value != "" and field_value is not sameas false %} {{ field_cfg.label }}: {{ field_value }} {% endif %} {% endfor %}
{% endif %} {# Bottom row: tags + branches #}
{% for tag in item.tags %} {{ tag }} {% endfor %} {% for branch in item.applies_to %} {{ branch }} {% endfor %}
{# Deleted indicator #} {% if item.deleted_at %}
{{ t("common.deleted") }}
{% endif %}
{% elif view == "list" %} {# ── Table row ── #} {# ID #} {{ item.local_id }} {# Kind badge #} {{ kind_label(item.kind, project) }} {# Title (clickable) #} {{ item.title }} {% if item.deleted_at %} {{ t("common.deleted") }} {% endif %} {% if item.custom_fields %}
{% for field_key, field_cfg in project.custom_fields.items() %} {% set field_value = item.custom_fields.get(field_key) %} {% if field_value is sameas true %} {{ field_cfg.label }}: {{ t("custom_fields.true") }} {% elif field_value is not none and field_value != "" and field_value is not sameas false %} {{ field_cfg.label }}: {{ field_value }} {% endif %} {% endfor %}
{% endif %} {# Status badge with dot #} {{ status_label(item.status, project) }} {# Tags #}
{% for tag in item.tags %} {{ tag }} {% endfor %}
{# Branches #}
{% for branch in item.applies_to %} {{ branch }} {% endfor %}
{# Updated at #} {{ item.updated_at[:16] | replace('T', ' ') }} {% elif view == "mobile" %}
{{ item.local_id }} {{ kind_label(item.kind, project) }}
{{ item.title }} {% if item.custom_fields %}
{% for field_key, field_cfg in project.custom_fields.items() %} {% set field_value = item.custom_fields.get(field_key) %} {% if field_value is sameas true %} {{ field_cfg.label }}: {{ t("custom_fields.true") }} {% elif field_value is not none and field_value != "" and field_value is not sameas false %} {{ field_cfg.label }}: {{ field_value }} {% endif %} {% endfor %}
{% endif %}
{{ status_label(item.status, project) }}
{% if item.tags or item.applies_to %}
{% for tag in item.tags %} {{ tag }} {% endfor %} {% for branch in item.applies_to %} {{ branch }} {% endfor %}
{% endif %}
{{ t("common.updated") }}
{% endif %}