{# Small shared pieces: icons and badges. Every coloured badge carries a word. #} {% macro icon(name, cls="ico") %}{% endmacro %} {% macro sev(severity) -%} {%- set s = (severity or '')|lower -%} {%- if s in ('critical', 'major', 'minor', 'informational') -%} {{ s }} {%- else -%} unrated {%- endif -%} {%- endmacro %} {% macro lic(label, cls) -%} {{ label }} {%- endmacro %} {% macro lic_class(cls) -%} {{ LIC_WORDS.get(cls, cls) }} {%- endmacro %} {% macro eng(e, loads_in, fails_in) -%} {%- set n = e|eng_short -%} {%- if e in (loads_in or []) -%} {{ n }}✓ {%- elif e in (fails_in or []) -%} {{ n }}✗ {%- else -%} {{ n }}- {%- endif -%} {%- endmacro %} {% macro engs(engines, loads_in, fails_in) -%} {% for e in engines %}{{ eng(e, loads_in, fails_in) }}{% endfor %} {%- endmacro %} {% macro when(dt) -%} {{ dt|reltime }} {%- endmacro %} {% macro token() %}{% endmacro %} {% macro copy_btn(target, label="Copy", cls="btn btn-sm") -%} {%- endmacro %} {% macro run_status(r) -%} {%- set cls = {'passed': 'val-valid', 'failed': 'val-invalid', 'error': 'val-invalid', 'running': 'val-warnings'}.get(r.status, '') -%} {{ r.status }}{% if r.accepted %} accepted{% endif %} {%- endmacro %} {% macro crumbs(items) -%}
    {% for label, href in items %}
  1. {% if href %}{{ label }}{% else %}{{ label }}{% endif %}
  2. {% endfor %}
{%- endmacro %} {#- Overview charts (shared with suriharvest). ages: present.age_chart; t: present.spark. SVG geometry only, no inline style. -#} {% macro age_chart(ages, noun='rules') -%}
Last changed {{ ages.share }}% of the {{ noun }} in the last 12 months
{%- for c in ages.cols %}{{ c.label }}: {{ c.n|num }} {{ noun if c.n != 1 else noun[:-1] }}{% endfor %}
{% if ages.unknown %}

{{ ages.unknown|num }} {{ noun ~ ' carry' if ages.unknown != 1 else noun[:-1] ~ ' carries' }} no date.

{% endif %}
{%- endmacro %} {% macro spark(t, label) -%} {%- if t %}{{ label }}{% endif -%} {%- endmacro %} {#- A 100% bar of the corpus split by one dimension (level, severity); parts: present.composition. -#} {% macro composition(parts, caption) -%} {%- if parts %}

{{ caption }}

{% endif -%} {%- endmacro %}