{# Visual marker for the work-item kind. `task` is the default and renders
blank to keep typical cards uncluttered. #}
{% set KIND_GLYPHS = {
'spec': '◆', 'epic': '◇', 'story': '◉', 'bug': '●',
'rfc': '✎', 'incident': '⚠'
} %}
{% set PROVIDER_GLYPHS = {
'linear': 'L', 'github': 'GH', 'trello': 'T',
'jira': 'J', 'azure': 'AZ', 'slack': 'S'
} %}
{% macro chip_kind(kind) -%}
{% if kind and kind != 'task' -%}
{{ KIND_GLYPHS.get(kind, '◾') }}{{ kind }}
{%- endif %}
{%- endmacro %}
{% macro chip_source(provider, url, ref, label) -%}
{% if provider or url or ref or label -%}
{% set glyph = PROVIDER_GLYPHS.get((provider or '') | lower, '↗') -%}
{% set body = ref or label or provider or 'ext' -%}
{% set tip_parts = [] -%}
{% if label %}{% set _ = tip_parts.append(label) %}{% endif -%}
{% if provider %}{% set _ = tip_parts.append(provider) %}{% endif -%}
{% if ref %}{% set _ = tip_parts.append(ref) %}{% endif -%}
{% if url %}{% set _ = tip_parts.append(url) %}{% endif -%}
{{ glyph }}{{ body }}
{%- endif %}
{%- endmacro %}
{% macro chip_parent(parent_id) -%}
{% if parent_id -%}
↑{{ parent_id }}
{%- endif %}
{%- endmacro %}
{% macro chip_repo(projects_list) -%}
{% if projects_list -%}
{% set head = projects_list[0] -%}
{% set extra_count = projects_list | length - 1 -%}
▸{{ head }}{% if extra_count > 0 %} {% endif %}
{%- endif %}
{%- endmacro %}
{% macro chip_deps(depends_list, alias) -%}
{% if depends_list -%}
{% set head = depends_list[0] -%}
{% set extra_count = depends_list | length - 1 -%}
↳{{ head }}{% if extra_count > 0 %} {% endif %}
{%- endif %}
{%- endmacro %}