fix(library): expose Delete control for Daedalus-managed libraries in UI
The backend already allows admin delete of a workspace-scoped Library via
the shared delete_library_cascade (commit 142e967), and the confirm-delete
page carries the Daedalus caution. But the detail template was never updated
to match: the Delete button stayed hardcoded `disabled` for any library with
a workspace_id, and the banner said "Do not delete it manually." So the
working route was unreachable from the UI — admins still could not clear an
orphaned Library blocking workspace re-registration.
Make Delete an unconditional enabled link to library:library-delete (the
confirm page already warns), and rewrite the workspace banner to describe the
escape hatch (deleting here removes embedded content; Daedalus recreates and
re-embeds on the next sync) instead of forbidding it.
Template-only change; no view/model/migration changes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -25,14 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2">
|
<div class="flex gap-2">
|
||||||
<a href="{% url 'library:library-edit' uid=library.uid %}" class="btn btn-sm btn-outline">Edit</a>
|
<a href="{% url 'library:library-edit' uid=library.uid %}" class="btn btn-sm btn-outline">Edit</a>
|
||||||
{% if library.workspace_id %}
|
|
||||||
<button type="button" class="btn btn-sm btn-error btn-outline" disabled
|
|
||||||
title="This library is managed by Daedalus. Delete it from the Daedalus workspace, not here.">
|
|
||||||
Delete
|
|
||||||
</button>
|
|
||||||
{% else %}
|
|
||||||
<a href="{% url 'library:library-delete' uid=library.uid %}" class="btn btn-sm btn-error btn-outline">Delete</a>
|
<a href="{% url 'library:library-delete' uid=library.uid %}" class="btn btn-sm btn-error btn-outline">Delete</a>
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -43,8 +36,11 @@
|
|||||||
<div class="text-sm opacity-80">
|
<div class="text-sm opacity-80">
|
||||||
This library was created for Daedalus workspace
|
This library was created for Daedalus workspace
|
||||||
<code class="font-mono">{{ library.workspace_id }}</code>.
|
<code class="font-mono">{{ library.workspace_id }}</code>.
|
||||||
Items here are owned by the workspace; deleting the workspace in
|
Normally you manage it from Daedalus. Deleting it here removes its
|
||||||
Daedalus will remove this library. Do not delete it manually.
|
embedded content from Mnemosyne, but the source files still live in
|
||||||
|
Daedalus — it will be recreated and re-embedded on the next sync.
|
||||||
|
Use Delete to clear an orphaned library that is blocking workspace
|
||||||
|
re-registration.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user