{%- import "default/view/theme.txt" as theme -%}
{%- block header -%}
{%- if not patch_only -%}
{{ "          Id" | colourise(theme.heading_colour) }}: {{ bug.number }}
{{ "       Title" | colourise(theme.heading_colour) }}: {{ bug.title }}
{{ "      Labels" | colourise(theme.heading_colour) }}: {{ bug.labels | join(", ", "name") }}
{{ "   Milestone" | colourise(theme.heading_colour) }}: {{ bug.milestone.title }}
{{ "     Created" | colourise(theme.heading_colour) }}: {{ bug.created_at | relative_time }} by {{ bug.user.login | colourise(theme.highlight_colour) }}
{{ "     Updated" | colourise(theme.heading_colour) }}: {{ bug.updated_at | relative_time }}
{{ "       State" | colourise(theme.heading_colour) }}: {{ bug.state }}{% if bug.closed_at %} {{ bug.closed_at | relative_time }}{% endif %}
{{ "    Comments" | colourise(theme.heading_colour) }}: {{ bug.comments }}
{{ "Pull request" | colourise(theme.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(theme.error_colour) }}
{%- endif -%}
{% endblock -%}
{%- block comments %}
{%- if not patch_only -%}
{%- if full and bug.comments > 0 -%}
{% for comment in comments %}

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

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