{% extends "repo_master.html" %}
{% block title %}Home{% endblock %}
{%block tag %}home{% endblock %}
{% block repo %}
<h2>Issues</h2>
<span class="create_issue">
{% if '/fork/' in request.url %}
<a href="{{ url_for('fork_new_issue', username=username, repo=repo.name) }}">
{% else %}
<a href="{{ url_for('new_issue', repo=repo.name) }}">
{% endif %}
<button>Create new issue</button>
</a>
</span>
<section class="issues_list">
{% if issues %}
<ul>
{% for issue in issues %}
<li>
#{{ issue.id }}
{% if '/fork/' in request.url %}
<a href="{{ url_for('view_fork_issue', username=username,
repo=repo.name, issueid=issue.id) }}">
{% else %}
<a href="{{ url_for('view_issue',
repo=repo.name, issueid=issue.id) }}">
{% endif %}
{{ issue.title }}
</a>
<span> Opened by
<a href="{{ url_for('view_user', username=issue.user) }}">
{{issue.user}}
</a> on {{ issue.date_created.strftime('%Y-%m-%d %H:%M') }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p>
No issues have been opened for this project.
</p>
{% endif %}
</section>
{% endblock %}