{% extends "base.html" %}

{% block title %}
{{ issue.title }}
{% endblock %}

{% block head %}
{{ super() }}
{% endblock %}

{% block content %}
<div class="main">

<h1>{{ self.title() }}</h1>

{% from 'macros.html' import linkindex %}
{{ linkindex(project) }}

{% if issue.desc %}
<div class="description">
<p>{{ issue.desc|addlinks }}</p>
</div>
{% endif %}

<h2>Details</h2>

{% set release = issue|release %}
{% set component = issue|component %}

<table>
  <tbody>
    <tr>
      <td class="attrname">Id:</td>
      <td class="attrval"><span class="id">{{ issue.id }}</span></td>
    </tr>

    <tr>
      <td class="attrname">Type:</td>
      <td class="attrval">{{ issue.type|replace(":", "") }}</td>
    </tr>

    <tr>
      <td class="attrname">Creation time:</td>
      <td class="attrval">{{ issue.creation_time|timeformat }}</td>
    </tr>

    <tr>
      <td class="attrname">Creator:</td>
      <td class="attrval"><span class="person">{{ issue.reporter|email|e }}</span></td>
    </tr>

    {% if issue.references %}
    <tr>
      <td class="attrname">References:</td>
      <td class="attrval">
	{% for ref in issue.references %}
	[{{ loop.index }}] <a href="{{ ref }}">{{ ref }}</a><br/>
	{% endfor %}
      </td>
    </tr>
    {% endif %}

    <tr>
      <td class="attrname">Release:</td>
      <td class="attrval">
	{% if release %}
	{{ release|link }}
	{% if release.released %}
        (released {{ release.release_time|dateformat }})
	{% else %}
        (unreleased)
	{% endif %}
	{% else %}
	<a href="unassigned.html">unassigned</a>
	{% endif %}
      </td>
    </tr>

    <tr>
      <td class="attrname">Component:</td>
      <td class="attrval">{{ component|link }}</td>
    </tr>

    <tr>
      <td class="attrname">Status:</td>
      <td class="attrval">
	{{ issue.status|replace(":", "") }}
	{% if issue.closed %}
	: {{ issue.disposition|replace(":", "") }}
	{% endif %}
	{{ issue|imagetag }}
      </td>
    </tr>
  </tbody>
</table>

<h2>Issue log</h2>

{% from 'macros.html' import event_log %}
{{ event_log(issue.log_events) }}

</div>
{% endblock %}
