{%- if id_len == 1 -%}
{% set id_format = "%2d" %}
{%- else -%}
{% set id_format = "%%%dd" | format(id_len) %}
{%- endif -%}
{%- block header -%}
{{ "Id" | colourise("green") }} {{ spacer }}{{ "Title" | colourise("green") }}
{%- endblock %}
{%- block body %}
{%- for bug in bugs %}
{%- if bug.labels %}
{%- set formatted_labels = " [" + bug.labels | join(", ") | colourise(on_color="on_blue") + "]" %}
{% else %}
{%- set formatted_labels = "" %}
{% endif -%}
{{ id_format | format(bug.number) | colourise("yellow") }} {{ bug.title + formatted_labels | truncate(max_title, True) }}
{%- endfor %}
{% endblock -%}

{%- block footer %}
{{ bugs | length | colourise("green") }} {{ state }} bug{% if bugs | length != 1 %}s{% endif %} found{% if term %} matching {{ term | colourise("green") }}{% endif %}
{%- endblock %}
