atr/templates/revisions-selected.html (115 lines of code) (raw):
{% extends "layouts/base.html" %}
{% block title %}
Revisions of {{ release.short_display_name }} ~ ATR
{% endblock title %}
{% block description %}
View the revision history for the {{ release.short_display_name }} candidate draft.
{% endblock description %}
{% block content %}
<p class="d-flex justify-content-between align-items-center">
{% if phase_key == "draft" %}
<a href="{{ as_url(routes.compose.selected, project_name=release.project.name, version_name=release.version) }}"
class="atr-back-link">← Back to Compose {{ release.short_display_name }}</a>
<span>
<strong class="atr-phase-one atr-phase-symbol">①</strong>
<span class="atr-phase-one atr-phase-label">COMPOSE</span>
<span class="atr-phase-arrow">→</span>
<span class="atr-phase-symbol-other">②</span>
<span class="atr-phase-arrow">→</span>
<span class="atr-phase-symbol-other">③</span>
</span>
{% elif phase_key == "preview" %}
<a href="{{ as_url(routes.finish.selected, project_name=release.project.name, version_name=release.version) }}"
class="atr-back-link">← Back to Finish {{ release.short_display_name }}</a>
<span>
<span class="atr-phase-symbol-other">①</span>
<span class="atr-phase-arrow">→</span>
<strong class="atr-phase-symbol-other">②</strong>
<span class="atr-phase-arrow">→</span>
<strong class="atr-phase-three atr-phase-symbol">③</strong>
<span class="atr-phase-three atr-phase-label">FINISH</span>
</span>
{% else %}
<a href="{{ as_url(routes.root.index) }}" class="atr-back-link">← Back to Select a release</a>
{% endif %}
</p>
<h1>
Revisions of <strong>{{ release.project.short_display_name }}</strong> <em>{{ release.version }}</em>
</h1>
{% if revision_history %}
{% for revision in revision_history %}
<div id="{{ revision.name }}" class="card mb-3">
<div class="card-header d-flex justify-content-between align-items-center">
<h2 class="fs-6 my-2 mx-0 p-0 border-0 atr-sans">
<a href="#{{ revision.name }}"
class="fw-bold text-decoration-none text-body">{{ revision.name }}</a>
{% if revision.name == current_revision_name %}<span class="badge bg-primary ms-2">Current</span>{% endif %}
</h2>
<span class="fs-6 text-muted">
{% if revision.timestamp %}
{{ revision.timestamp.strftime("%Y-%m-%d %H:%M:%S UTC") }}
{% else %}
Invalid timestamp
{% endif %}
by {{ revision.editor }}
</span>
</div>
<div class="card-body">
{% if revision.parent %}
<p class="small text-muted mb-2">
Changes from parent revision: <a href="#{{ revision.parent }}">{{ revision.parent }}</a>
</p>
{% else %}
<p class="small text-muted mb-2">Initial revision</p>
{% endif %}
{% if not revision.added and not revision.removed and not revision.modified %}
<p class="fst-italic text-muted">No file changes detected in this revision.</p>
{% else %}
{% if revision.added %}
<h3 class="fs-6 fw-semibold mt-3 atr-sans">
Added files <span class="font-monospace fw-normal">({{ revision.added|length }})</span>
</h3>
<ul class="list-group list-group-flush mb-2">
{% for file in revision.added %}
<li class="list-group-item list-group-item-success py-1 px-3 small rounded-2">{{ file }}</li>
{% endfor %}
</ul>
{% endif %}
{% if revision.removed %}
<h3 class="fs-6 fw-semibold mt-3 atr-sans">
Removed files <span class="font-monospace fw-normal">({{ revision.removed|length }})</span>
</h3>
<ul class="list-group list-group-flush mb-2">
{% for file in revision.removed %}
<li class="list-group-item list-group-item-danger py-1 px-3 small rounded-2">{{ file }}</li>
{% endfor %}
</ul>
{% endif %}
{% if revision.modified %}
<h3 class="fs-6 fw-semibold mt-3 atr-sans">
Modified files <span class="font-monospace fw-normal">({{ revision.modified|length }})</span>
</h3>
<ul class="list-group list-group-flush mb-2">
{% for file in revision.modified %}
<li class="list-group-item list-group-item-warning py-1 px-3 small rounded-2">{{ file }}</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% if revision.name != current_revision_name %}
<h3 class="fs-6 fw-semibold mt-3 atr-sans">Actions</h3>
<div class="mt-3">
<form method="post"
action="{{ as_url(routes.revisions.selected_post, project_name=project_name, version_name=version_name) }}">
<input type="hidden" name="revision_name" value="{{ revision.name }}" />
<button type="submit" class="btn btn-sm btn-outline-danger">Set this revision as current</button>
</form>
</div>
{% endif %}
</div>
</div>
{% endfor %}
{% else %}
<div class="alert alert-info">No revision history found for this candidate draft.</div>
{% endif %}
{% endblock content %}