feat: add delete button for revoked API tokens

Revoked tokens previously stayed in the list with no way to remove them.
Adds a delete action (hard delete, scoped to the owner, gated behind
demo mode) shown on revoked rows, alongside the existing revoke action on
active ones.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
obervinov
2026-06-29 23:55:38 +04:00
parent 106d721279
commit 0fb37a59fa
4 changed files with 59 additions and 0 deletions
@@ -87,6 +87,21 @@
_="install prompt_swal">
<i class="fa-solid fa-ban fa-fw"></i>
</a>
{% else %}
<a class="btn btn-error btn-sm"
role="button"
data-tippy-content="{% translate 'Delete' %}"
hx-delete="{% url 'user_api_token_delete' token_id=token.id %}"
hx-target="#api-token-settings"
hx-swap="innerHTML"
hx-trigger="confirmed"
data-bypass-on-ctrl="true"
data-title="{% translate 'Delete token?' %}"
data-text="{% translate 'This permanently removes the token from the list. It cannot be undone.' %}"
data-confirm-text="{% translate 'Yes, delete it!' %}"
_="install prompt_swal">
<i class="fa-solid fa-trash fa-fw"></i>
</a>
{% endif %}
</td>
</tr>