a73x

src/server/http/templates/patches.html

Ref:   Size: 2.9 KiB   History

{% extends "repo_base.html" %}

{% block title %}Patches — {{ repo_name }} — {{ site_title }}{% endblock %}

{% block content %}
<h2>Patches</h2>
<p class="filter-bar">
  Showing:
  <a href="/{{ repo_name }}/patches?filter=open"{% if filter == "open" %} class="active"{% endif %}>open</a>
  <a href="/{{ repo_name }}/patches?filter=closed"{% if filter == "closed" %} class="active"{% endif %}>closed</a>
  <a href="/{{ repo_name }}/patches?filter=merged"{% if filter == "merged" %} class="active"{% endif %}>merged</a>
  <a href="/{{ repo_name }}/patches?filter=all"{% if filter == "all" %} class="active"{% endif %}>all</a>
  {# The review queue: open patches with feedback nobody has answered. Last in
     the bar because it narrows `open` rather than sitting beside it. #}
  <a href="/{{ repo_name }}/patches?filter=unresolved"{% if filter == "unresolved" %} class="active"{% endif %}>unresolved</a>
</p>
{% if patches.is_empty() %}
{# An empty *filtered* list is not an empty repository. Saying "No patches."
   under the default `open` filter was simply false on a repo whose work had
   all landed, and the only clue was one bold word among four links. See
   issue c43c459d. #}
{% if total == 0 %}
<p style="color: #666;">No patches yet.</p>
{% else if filter == "unresolved" %}
{# "No unresolved patches" would name the filter but not what it means. An
   empty review queue is good news and should read as such. #}
<p style="color: #666;">No patches with unanswered feedback. ({{ total }} total —
  <a href="/{{ repo_name }}/patches?filter=all">show all</a>)</p>
{% else %}
<p style="color: #666;">No {{ filter }} patches. ({{ total }} total —
  <a href="/{{ repo_name }}/patches?filter=all">show all</a>)</p>
{% endif %}
{% else %}
<div class="table-scroll">
<table>
  <thead>
    <tr>
      <th>ID</th>
      <th>Status</th>
      <th>Title</th>
      <th>Author</th>
      <th>Labels</th>
      <th>Base</th>
      <th>Unresolved</th>
      <th>Updated</th>
    </tr>
  </thead>
  <tbody>
    {% for p in patches %}
    <tr>
      <td class="mono"><a href="/{{ repo_name }}/patches/{{ p.id }}">{{ p.short_id }}</a></td>
      <td><span class="status-{{ p.status }}">{{ p.status }}</span></td>
      <td><a href="/{{ repo_name }}/patches/{{ p.id }}">{{ p.title }}</a></td>
      <td style="color: #666;">{{ p.author }}</td>
      <td style="color: #666;">{{ p.labels }}</td>
      <td class="mono" style="color: #666;">{{ p.base_ref }}</td>
      {# Blank rather than 0, matching `patch list`: a column of zeroes trains
         the eye to skip the column. The heading still says what it counts. #}
      <td class="mono">{% if p.unresolved > 0 %}<span style="color: #b60;">{{ p.unresolved }}</span>{% endif %}</td>
      <td class="mono timestamp" style="color: #666;" title="{{ p.updated.full }}">{{ p.updated.short }}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
</div>
{% endif %}
{% endblock %}