{%- set heading_colour = "green" -%}
{%- set user_colour = "yellow" -%}
{%- block header -%}
{%- if not patch_only -%}
{{ "          Id" | colourise(heading_colour) }}: {{ bug.number }}
{{ "       Title" | colourise(heading_colour) }}: {{ bug.title }}
{{ "      Labels" | colourise(heading_colour) }}: {{ bug.labels | join(", ", "name") }}
{{ "     Created" | colourise(heading_colour) }}: {{ bug.created_at | relative_time }} by {{ bug.user.login | colourise(user_colour) }}
{{ "     Updated" | colourise(heading_colour) }}: {{ bug.updated_at | relative_time }}
{{ "       State" | colourise(heading_colour) }}: {{ bug.state }}{% if bug.closed_at %} {{ bug.closed_at | relative_time }}{% endif %}
{{ "    Comments" | colourise(heading_colour) }}: {{ bug.comments }}
{{ "Pull request" | colourise(heading_colour) }}: {% if bug.pull_request_url %}{{ bug.pull_request_url }}{% else %}No{% endif %}
{%- endif -%}
{% endblock -%}
{%- block body %}
{%- if not patch_only -%}
{%- if bug.body_html %}
{{ bug.body_html | html2text }}
{%- endif -%}
{%- endif -%}
{% endblock %}
{% block patch %}
{%- if patch -%}
{{ patch | highlight }}
{%- elif patch_only -%}
{{ "Not a pull request!" | colourise('red') }}
{%- endif -%}
{% endblock -%}
{%- block comments %}
{%- if not patch_only -%}
{%- if full and bug.comments > 0 -%}
{% for comment in comments %}

{{ " Comment" | colourise(heading_colour) }}: {{ loop.index }}
{{ " Created" | colourise(heading_colour) }}: {{ comment.created_at | relative_time }} by {{ comment.user.login | colourise(user_colour) }}
{{ " Updated" | colourise(heading_colour) }}: {{ comment.updated_at | relative_time }}

{{ comment.body_html | html2text }}
{%- endfor %}
{%- endif -%}
{%- endif -%}
{% endblock %}
