Login
4 branches 0 tags
Ben (T14s/Arch Linux) Improved issue view 5800a5d 1 month ago 170 Commits
rubhub / templates / issues_list.html
<!DOCTYPE html>
<html>

  <head>
    <title>{{ owner.name }}/{{ project.name }} - Issues</title>
  </head>

  <body>
    {% include "sidebar.html" %}
    <main>
      <section>
        <div class="page-header">
          <h1 class="project-header">
            <a href="{{ owner.uri() }}">{{ owner.name }}</a> /
            <a href="{{ project.uri() }}">{{ project.name }}</a> /
            <a href="{{ project.uri_issues() }}">Issues</a>
          </h1>
        </div>

        {% include "project_tabs.html" %}

        <div class="card">
          <div class="issues-header">
            <h2>Issues</h2>
            <div class="issues-actions">
              <div class="issue-filters">
                {# Open button - toggle showOpen #}
                {% if show_open %}
                <a href="{{ project.uri_issues() }}?showOpen=false{% if show_completed %}&showCompleted=true{% endif %}{% if show_cancelled %}&showCancelled=true{% endif %}" class="btn btn-filter issue-open active">Open {{ count_open }}</a>
                {% else %}
                <a href="{{ project.uri_issues() }}{% if show_completed || show_cancelled %}?{% endif %}{% if show_completed %}showCompleted=true{% endif %}{% if show_cancelled %}{% if show_completed %}&{% endif %}showCancelled=true{% endif %}" class="btn btn-filter issue-open">Open {{ count_open }}</a>
                {% endif %}

                {# Completed button - toggle showCompleted #}
                {% if show_completed %}
                <a href="{{ project.uri_issues() }}{% if !show_open || show_cancelled %}?{% endif %}{% if !show_open %}showOpen=false{% endif %}{% if show_cancelled %}{% if !show_open %}&{% endif %}showCancelled=true{% endif %}" class="btn btn-filter issue-completed active">Completed {{ count_completed }}</a>
                {% else %}
                <a href="{{ project.uri_issues() }}?{% if !show_open %}showOpen=false&{% endif %}showCompleted=true{% if show_cancelled %}&showCancelled=true{% endif %}" class="btn btn-filter issue-completed">Completed {{ count_completed }}</a>
                {% endif %}

                {# Closed button - toggle showCancelled #}
                {% if show_cancelled %}
                <a href="{{ project.uri_issues() }}{% if !show_open || show_completed %}?{% endif %}{% if !show_open %}showOpen=false{% endif %}{% if show_completed %}{% if !show_open %}&{% endif %}showCompleted=true{% endif %}" class="btn btn-filter issue-cancelled active">Closed {{ count_cancelled }}</a>
                {% else %}
                <a href="{{ project.uri_issues() }}?{% if !show_open %}showOpen=false&{% endif %}{% if show_completed %}showCompleted=true&{% endif %}showCancelled=true" class="btn btn-filter issue-cancelled">Closed {{ count_cancelled }}</a>
                {% endif %}
              </div>
              {% if logged_in_user.is_some() %}
              <a href="/~{{ owner.slug }}/{{ project.slug }}/issues/new" class="btn">
                New Issue
              </a>
              {% endif %}
            </div>
          </div>

          {% if issues.is_empty() %}
          <p class="empty-state">No issues yet.</p>
          {% else %}
          <div class="issues-list">
            {% for issue in issues %}
            <div class="issue-item issue-{{ issue.status.as_str() }}">
              <a href="{{ issue.uri(&owner.slug, &project.slug) }}" class="issue-link">
                <span class="issue-title">{{ issue.title }}</span>
                <span class="issue-meta">
                  opened by {{ issue.author }} -
                  {{ issue.comment_count }} comment{% if issue.comment_count != 1 %}s{% endif %}
                </span>
              </a>
              <span class="issue-status status-{{ issue.status.as_str() }}">{{ issue.status.as_str() }}</span>
            </div>
            {% endfor %}
          </div>
          {% endif %}
        </div>
      </section>
    </main>
  </body>

</html>