intent/templates/features/detail.html
Alec Perkins b9378b8397 Add projects and features with revision history (Phase 2)
Projects under organizations with fixed URL name and feature ID
prefix, three visibility levels, open contribution, per-project
roles, settings and typed-confirmation delete. Hidden projects 404.
Leaving an org drops its project roles. Project access rules live in
intent/access.py alongside org access.

Features numbered per project (INT-12) in a tree. Every change is a
revision with a required note; history, old revisions, and
side-by-side field and line diffs between any two. Cycles and
superseded-without-replacement are rejected. Markdown renders safely
with source-line attributes for Phase 3 line comments and headings
shifted below the page h1. Server-side preview works without JS.

Structural accessibility check runs on every page in tests.

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

69 lines
2.7 KiB
HTML

{% extends "projects/base.html" %}
{% block page_title %}{{ feature.key }} {{ feature.title }}{% endblock %}
{% block project_content %}
{% include "features/_header.html" %}
{% if feature.status == "withdrawn" %}
<p role="note"><strong>Withdrawn.</strong> This feature is no longer planned.</p>
{% elif feature.status == "superseded" %}
<p role="note"><strong>Superseded</strong> by <a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=feature.superseded_by.key %}">{{ feature.superseded_by.key }} {{ feature.superseded_by.title }}</a>.</p>
{% endif %}
<dl>
<dt>Status</dt>
<dd>{{ feature.get_status_display }}</dd>
<dt>Revision</dt>
<dd>
{{ feature.current_revision }}
(<a href="{% url 'features:history' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">history</a>)
</dd>
{% if latest %}
<dt>Last change</dt>
<dd>
<time datetime="{{ latest.created_at|date:'c' }}">{{ latest.created_at|date:"j M Y" }}</time>
by {{ latest.author.username|default:"unknown" }}: {{ latest.note }}
</dd>
{% endif %}
</dl>
{% if access.can_edit %}
<ul>
<li><a href="{% url 'features:edit' org_slug=project.org.slug project_slug=project.slug feature_key=feature.key %}">Edit</a></li>
<li><a href="{% url 'features:create' org_slug=project.org.slug project_slug=project.slug %}?parent={{ feature.key }}">Add a sub-feature</a></li>
</ul>
{% endif %}
<section aria-labelledby="description-heading">
<h2 id="description-heading" class="visually-hidden">Description</h2>
<div class="prose">
{% if feature.description %}{{ description }}{% else %}<p class="muted">No description yet.</p>{% endif %}
</div>
</section>
{% if children %}
<section aria-labelledby="children-heading">
<h2 id="children-heading">Sub-features</h2>
<ul>
{% for child in children %}
<li>
<a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=child.key %}">{{ child.key }} {{ child.title }}</a>
{% if child.status != "active" %}<span class="muted">({{ child.get_status_display|lower }})</span>{% endif %}
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% if supersedes %}
<section aria-labelledby="supersedes-heading">
<h2 id="supersedes-heading">Replaces</h2>
<ul>
{% for old in supersedes %}
<li><a href="{% url 'features:detail' org_slug=project.org.slug project_slug=project.slug feature_key=old.key %}">{{ old.key }} {{ old.title }}</a></li>
{% endfor %}
</ul>
</section>
{% endif %}
{% endblock %}