intent/templates/features/history.html

62 lines
3.1 KiB
HTML
Raw Normal View History

{% extends "projects/base.html" %}
{% block page_title %}History of {{ feature.key }}{% endblock %}
{% block project_content %}
<p><a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">Back to {{ feature.key }}</a></p>
<h1>History of <span class="muted">{{ feature.key }}</span> {{ feature.title }}</h1>
<form method="get" action="{% url 'features:compare' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">
<table>
<caption>{{ rows|length }} revision{{ rows|length|pluralize }}, newest first</caption>
<thead>
<tr>
<th scope="col">Revision</th>
<th scope="col">Date</th>
<th scope="col">Author</th>
<th scope="col">Note</th>
<th scope="col">Issues</th>
<th scope="col">Changed</th>
{% if rows|length > 1 %}
<th scope="col">From</th>
<th scope="col">To</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for row in rows %}
{% with rev=row.revision %}
<tr>
<th scope="row">
{% if rev.revision == feature.current_revision %}
<a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">{{ rev.revision }}</a> (current)
{% else %}
<a href="{% url 'features:revision' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key revision=rev.revision %}">{{ rev.revision }}</a>
{% endif %}
</th>
<td><time datetime="{{ rev.created_at|date:'c' }}">{{ rev.created_at|date:"j M Y, H:i" }}</time></td>
<td>{{ rev.author.username|default:"ghost" }}</td>
<td>{{ rev.note }}</td>
<td>{% for issue in rev.issues.all %}<a href="{% url 'issues:detail' org_slug=project.org.slug project_slug=project.slug number=issue.number %}">{{ issue.key }}</a>{% if not forloop.last %}, {% endif %}{% empty %}—{% endfor %}</td>
<td>{{ row.changes|join:", " }}</td>
{% if rows|length > 1 %}
<td>
<input type="radio" name="old" value="{{ rev.revision }}" id="old-{{ rev.revision }}"{% if rev.revision == feature.current_revision|add:-1 %} checked{% endif %}>
<label for="old-{{ rev.revision }}" class="visually-hidden">Compare from revision {{ rev.revision }}</label>
</td>
<td>
<input type="radio" name="new" value="{{ rev.revision }}" id="new-{{ rev.revision }}"{% if rev.revision == feature.current_revision %} checked{% endif %}>
<label for="new-{{ rev.revision }}" class="visually-hidden">Compare to revision {{ rev.revision }}</label>
</td>
{% endif %}
</tr>
{% endwith %}
{% endfor %}
</tbody>
</table>
{% if rows|length > 1 %}
<p><button type="submit">Compare selected revisions</button></p>
{% endif %}
</form>
{% endblock %}