intent/templates/features/revision.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

45 lines
2.1 KiB
HTML

{% extends "projects/base.html" %}
{% block page_title %}{{ feature.key }} revision {{ snapshot.revision }}{% endblock %}
{% block project_content %}
<p role="note">
<strong>Old revision.</strong>
You're viewing revision {{ snapshot.revision }} of {{ feature.current_revision }}.
<a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">View the current version</a>
or <a href="{% url 'features:compare' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}?old={{ snapshot.revision }}&amp;new={{ feature.current_revision }}">compare with it</a>.
</p>
<h1><span class="muted">{{ feature.key }}</span> {{ snapshot.title }}</h1>
<dl>
<dt>Status</dt>
<dd>{{ snapshot.get_status_display }}{% if snapshot.superseded_by %}, by {{ snapshot.superseded_by.key }} {{ snapshot.superseded_by.title }}{% endif %}</dd>
<dt>Parent</dt>
<dd>{% if snapshot.parent %}{{ snapshot.parent.key }} {{ snapshot.parent.title }}{% else %}None (top level){% endif %}</dd>
<dt>Change</dt>
<dd>
<time datetime="{{ snapshot.created_at|date:'c' }}">{{ snapshot.created_at|date:"j M Y" }}</time>
by {{ snapshot.author.username|default:"ghost" }}: {{ snapshot.note }}
</dd>
</dl>
<section aria-labelledby="description-heading">
<h2 id="description-heading" class="visually-hidden">Description</h2>
<div class="prose">
{% for block in blocks %}
<div class="block" id="{{ block.anchor }}">{{ block.html }}</div>
{% empty %}
<p class="muted">No description.</p>
{% endfor %}
</div>
</section>
{% if files %}
<section aria-labelledby="files-heading">
<h2 id="files-heading">Files at this revision</h2>
<ul>
{% for v in files %}
<li><a href="{% url 'files:detail' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key file_id=v.file_id %}?version={{ v.version }}">{{ v.original_name }}</a> <span class="muted">({{ v.file.get_kind_display|lower }}, version {{ v.version }})</span></li>
{% endfor %}
</ul>
</section>
{% endif %}
{% endblock %}