Blob Blame Raw
{% extends "repo_master.html" %}

{% block title %}Issues - {{ repo.name }}{% endblock %}
{%block tag %}home{% endblock %}


{% block repo %}

<div class="inline">
  <h2>
    {% if issues %}
    {% if issues[0].status != 'Open' %}
    Closed
    {% endif %}{% endif %}
    Issues
  </h2>
  {% if issues %}
    {% if issues[0].status == 'Open' %}
        {% if '/fork/' in request.url %}
          <a href="{{ url_for('view_fork_issues', username=username,
                     repo=repo.name) }}?status=Closed">
        {% else %}
          <a href="{{ url_for('view_issues', repo=repo.name) }}?status=Closed">
        {% endif %}
        (Closed)</a>
    {% else %}
        {% if '/fork/' in request.url %}
          <a href="{{ url_for('view_fork_issues', username=username,
                     repo=repo.name) }}">
        {% else %}
          <a href="{{ url_for('view_issues', repo=repo.name) }}">
        {% endif %}
        (Open)</a>
    {% endif %}
  {% endif %}
</div>

<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 %}