{# Inline SVG icons (docs/ui-design.md ยง4). Import with context: {% import "_icons.html" as icons with context %}. A label makes the icon an image for screen readers; without one it is decorative. #} {% macro _a11y(label) -%} {%- if label %}role="img" aria-label="{{ label }}"{% else %}aria-hidden="true"{% endif -%} {%- endmacro %} {# Severity and fact status: error, warn, info, present, missing, distorted, doubted, unchecked, and "none" for a count of zero (grey circle). #} {% macro sev(kind, label="", size=14) -%} {%- if kind in ("error", "missing", "none") -%} {%- elif kind in ("warn", "distorted", "doubted") -%} {%- elif kind == "present" -%} {%- elif kind == "unchecked" -%} {%- else -%} {%- endif -%} {%- endmacro %} {# The decision column of a block: all four icons, CSS shows the one that applies. #} {% macro decision_states() -%} {%- endmacro %} {# Line icons in the text colour. #} {% macro icon(name, size=16, label="") -%} {%- if name == "chevron-right" %} {%- elif name == "chevron-down" %} {%- elif name == "check" %} {%- elif name == "pencil" %} {%- elif name == "x" %} {%- elif name == "search" %} {%- elif name == "plus" %} {%- elif name == "download" %} {%- elif name == "upload" %} {%- elif name == "arrow-down" %} {%- elif name == "kebab" %} {%- elif name == "chip" %} {%- elif name == "code" %} {%- elif name == "person" %} {%- endif -%} {%- endmacro %} {# Who does a stage's work, as a grey tag with an icon. #} {% macro who(kind) -%} {{ icon('chip' if kind == 'model' else ('code' if kind == 'code' else 'person'), 12) }}{{ t('who.' ~ kind ~ '_title') if kind in ('code', 'human') else t('who.model') }} {%- endmacro %}