refactor: replace delete/undo flow with close/reopen endpoints

- POST /web/cases/:id/delete renamed to /close; emits CaseClosed.
- New POST /web/cases/:id/reopen removes the marker; emits CaseReopened.
- Bulk action "delete" renamed to "close"; the shared closed_at timestamp
  still groups the selection for future UI features.
- POST /web/cases/undo-delete removed along with summarize_latest_close_group,
  latest_close_timestamp and restore_close_group. Per-case reopen makes
  the group-undo banner obsolete.
- CaseEventKind::CaseDeleted -> CaseClosed, CaseRestored -> CaseReopened.
- Templates updated to Lucide trash-2 icon, German label "Fall schliessen".
- Tests migrated; delete_watermark_test.rs moved to close_watermark_test.rs.
This commit is contained in:
2026-04-21 10:43:39 +02:00
parent 9410d6daaa
commit 396565a571
11 changed files with 176 additions and 241 deletions
+8 -8
View File
@@ -264,13 +264,13 @@
<form
class="delete-form"
method="post"
action="/web/cases/{{ case_id }}/delete"
action="/web/cases/{{ case_id }}/close"
>
<button
type="submit"
class="delete-btn"
title="Fall entfernen"
aria-label="Fall entfernen"
title="Fall schließen"
aria-label="Fall schließen"
>
<svg
xmlns="http://www.w3.org/2000/svg"
@@ -283,13 +283,13 @@
stroke-linecap="round"
stroke-linejoin="round"
>
<polyline points="3 6 5 6 21 6"></polyline>
<path d="M3 6h18"></path>
<path
d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"
d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"
></path>
<path d="M10 11v6"></path>
<path d="M14 11v6"></path>
<path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"></path>
<path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
<line x1="10" x2="10" y1="11" y2="17"></line>
<line x1="14" x2="14" y1="11" y2="17"></line>
</svg>
</button>
</form>
+2 -9
View File
@@ -67,13 +67,6 @@ try {
</div>
</header>
{% if undo_count > 0 %}
<form class="bulk-bar" method="post" action="/web/cases/undo-delete" style="background:#fff8e1;">
<span><strong>{{ undo_count }}</strong> zuletzt gelöschte(r) Fall(/Fälle).</span>
<button type="submit">Löschung rückgängig</button>
</form>
{% endif %}
{% if total == 0 %}
<section><p class="empty">Keine Fälle.</p></section>
{% else %}
@@ -95,7 +88,7 @@ try {
<div class="actions">
{% if is_admin %}<button type="submit" formaction="/web/cases/{{ case.case_id }}/analyze" class="admin-only"{% if !case.can_analyze %} disabled{% endif %}>{% if case.has_document %}Neu analysieren{% else %}Analysieren{% endif %}</button>
<button type="submit" formaction="/web/cases/{{ case.case_id }}/reset" class="admin-only">Reset</button>{% endif %}
<button type="submit" formaction="/web/cases/{{ case.case_id }}/delete" class="delete-btn" title="Fall entfernen" aria-label="Fall entfernen"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path><path d="M10 11v6"></path><path d="M14 11v6"></path><path d="M9 6V4a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2"></path></svg></button>
<button type="submit" formaction="/web/cases/{{ case.case_id }}/close" class="delete-btn" title="Fall schließen" aria-label="Fall schließen"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"></path><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line></svg></button>
</div>
</li>
{% endfor %}
@@ -107,7 +100,7 @@ try {
<button type="button" onclick="const b=document.querySelectorAll('input[name=case_id]');const all=Array.from(b).every(c=>c.checked);b.forEach(c=>c.checked=!all);this.textContent=all?'Alles auswählen':'Keine auswählen'">Alles auswählen</button>
{% if is_admin %}<button type="submit" name="action" value="analyze" class="admin-only">Analysieren</button>
<button type="submit" name="action" value="reset" class="admin-only">Reset</button>{% endif %}
<button type="submit" name="action" value="delete">Entfernen</button>
<button type="submit" name="action" value="close">Schließen</button>
</div>
</form>
{% endif %}