{% extends "repo_master.html" %}
{% from "_formhelper.html" import render_field_in_list %}
{% block title %}Issue #{{ issue.id}} - {{ repo.name }}{% endblock %}
{%block tag %}home{% endblock %}
{% block repo %}
<h2>Issue #{{ issue.id }}</h2>
<section class="issue_action">
{% if username %}
<form action="{{ url_for('view_fork_issue', username=username,
repo=repo.name, issueid=issue.id) }}" method="post">
{% else %}
<form action="{{ url_for('view_issue',
repo=repo.name, issueid=issue.id) }}" method="post">
{% endif %}
<ul class="inline">
<li>
{% if '/fork/' in request.url %}
<a href="{{ url_for('fork_edit_issue', username=username,
repo=repo.name, issueid=issue.id) }}">
{% else %}
<a href="{{ url_for('edit_issue', repo=repo.name, issueid=issue.id) }}">
{% endif %}
Edit</a>
</li>
{{ render_field_in_list(form.status) }}
<li>
<input type="submit" class="submit positive button" value="Update">
</li>
</ul>
{{ form.csrf_token }}
</form>
</section>
<section class="issue_info">
<h3>
{{ issue.title }}
</h3>
<span class="issue_body">
{% autoescape false %}
{{ issue.content | rst2html }}
{% endautoescape %}
</span>
<p>
Opened by
<a href="{{ url_for('view_user', username=issue.user)}}">
{{ issue.user }}
</a>
on {{ issue.date_created | humanize}}
</p>
</section>
<div class="sep"></div>
<section class="issue_comments">
{% for comment in issue.comments %}
<span class="comment_body">
{% autoescape false %}
{{ comment.comment | rst2html }}
{% endautoescape %}
<p>
<a href="{{ url_for('view_user', username=comment.user)}}">
{{ comment.user }}
</a>
on {{ comment.date_created | humanize}}
</p>
</span>
{% endfor %}
</section>
<div class="sep"></div>
<section class="add_comment">
<form action="{{ url_for('add_comment_issue', username=username,
repo=repo.name, issueid=issue.id) }}" method="post">
<div>
<textarea id="comment" name="comment" title="comment"></textarea>
</div>
{{ form.csrf_token }}
<input type="submit" class="submit positive button" value="Comment">
</form>
</section>
{% endblock %}