fix user picture delete confirmation page

This commit is contained in:
imperosol
2026-09-09 22:48:34 +02:00
parent 8de4d9a4d0
commit db44e4bd02
3 changed files with 37 additions and 62 deletions
+29 -31
View File
@@ -4,15 +4,11 @@
{% trans %}Delete confirmation{% endtrans %}
{% endblock %}
{% if is_fragment %}
{# Don't display tabs and errors #}
{% block tabs %}
{% endblock %}
{% block errors %}
{% endblock %}
{% endif %}
{# Don't display tabs and errors #}
{% block tabs %}
{% endblock %}
{% block errors %}
{% endblock %}
{% block file %}
<h2>{% trans %}Delete confirmation{% endtrans %}</h2>
@@ -23,30 +19,32 @@
{% set action = current %}
{% endif %}
<form action="{{ action }}" method="post">
<p>{% trans obj=object %}Are you sure you want to delete "{{ obj }}"?{% endtrans %}</p>
<form
method="post"
{% if is_fragment %}
hx-action="{{ action }}"
hx-target="#content"
hx-swap="innerHTML"
{% else %}
action="{{ action }}"
{% endif %}
>
{% csrf_token %}
<p>{% trans obj=object %}Are you sure you want to delete "{{ obj }}"?{% endtrans %}</p>
<button
{% if is_fragment %}
hx-post="{{ action }}"
hx-target="#content"
hx-swap="innerHTML"
{% endif %}
>{% trans %}Confirm{% endtrans %}</button>
<button
{% if is_fragment %}
hx-get="{{ previous }}"
hx-target="#content"
hx-swap="innerHTML"
{% else %}
action="window.history.back()"
{% endif %}
>{% trans %}Cancel{% endtrans %}</button>
<input type="submit" value="{% trans %}Confirm{% endtrans %}" />
</form>
<form
method="get"
{% if is_fragment %}
hx-action="{{ previous }}"
hx-target="#content"
hx-swap="innerHTML"
{% else %}
action="javascript:history.back();"
{% endif %}
>
<input type="submit" name="cancel" value="{% trans %}Cancel{% endtrans %}" />
</form>
{% endblock %}