intent/templates/features/history.html
Alec Perkins 604c2bbf91
Some checks failed
ci / test (push) Failing after 1m6s
ci / deploy (push) Failing after 0s
Harden for launch: limits, CSP, moderation, admin 2FA (Phase 5)
- Rate limits in the shared cache for comments, issues, uploads and
  invites; a limited HTMX reply keeps the draft.
- Content-Security-Policy (self only, no inline script or style, bucket
  origin for images and frames) and Permissions-Policy on every page.
  htmx configured not to inject styles or eval.
- Moderation: deactivating a user ends their sessions and keeps their
  content; deleted accounts show as "ghost"; reserved usernames; the
  admin won't delete an org's last owner.
- Admin requires a TOTP code (django-otp), with add_admin_totp to enrol.
- Email provider chosen by environment through django-anymail.
- Playwright browser tests: axe WCAG 2.1 AA on every page in light and
  dark, no CSP violations, keyboard walkthrough, theme toggle. Explicit
  Canvas/CanvasText on :root fixes dark-mode contrast detection.
- bin/start creates the data dir if missing; docs/operations.md runbook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 10:51:06 -04:00

61 lines
3.1 KiB
HTML

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