fix: enforce write phase completion gate and wire done endpoint

- GET /write now checks all groups are written/skipped before showing
  the completion screen; incomplete sessions are redirected to the first
  draft group
- POST /write/done now accepts form data (not JSON) and redirects to
  /export; wired up from the completion screen via a <form> POST button
- phase5.html extra_scripts block wrapped in {% if group %} to prevent
  Jinja errors when group is None on the completion screen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 16:58:03 +02:00
parent 02c772f321
commit fade38e7a0
2 changed files with 17 additions and 5 deletions
@@ -7,7 +7,11 @@
</div>
{% if not group %}
<div class="alert alert-success">All groups written or skipped. <a href="/export?album_id={{ album_id }}" class="link">Continue to export →</a></div>
<div class="alert alert-success mb-4">All groups written or skipped.</div>
<form method="post" action="/write/done">
<input type="hidden" name="album_id" value="{{ album_id }}">
<button type="submit" class="btn btn-primary">Export →</button>
</form>
{% else %}
<div class="flex gap-4">
@@ -101,6 +105,7 @@
{% endblock %}
{% block extra_scripts %}
{% if group %}
<script>
(function() {
var albumId = {{ album_id | tojson }};
@@ -193,4 +198,5 @@
}
})();
</script>
{% endif %}
{% endblock %}