From 6153ca426f9f880c70564ecb2d5346d64c2802eb Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Mon, 5 Feb 2024 10:48:12 +0100 Subject: improve delete confirmation Make delete confirmations show information in a manner that is easier to read. This includes delete confirmations for centers, room and folder. Messages are now more clear. Also, content table shows the type of the items (folder, room, etc.) --- ogcp/templates/actions/delete_center.html | 30 ++++++++++++++++-------------- ogcp/templates/actions/delete_room.html | 18 +++++++++++------- ogcp/templates/actions/folder_delete.html | 30 ++++++++++++++++-------------- 3 files changed, 43 insertions(+), 35 deletions(-) (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/delete_center.html b/ogcp/templates/actions/delete_center.html index af89364..5379a58 100644 --- a/ogcp/templates/actions/delete_center.html +++ b/ogcp/templates/actions/delete_center.html @@ -9,12 +9,11 @@ {% block content %}

{{_('Delete center')}}

-{% if children %} -

The following items will be deleted

+

The following center and its content will be deleted

- -{% for c in children %} - - - -{% endfor %} +{% if children %} + {% for type, elements in children.items() %} + + + + + {% endfor %} +{% else %} + +{% endif %}
+ {% for x in ancestors %} {{x}} {% if not loop.last %} @@ -25,19 +24,22 @@
- {% if c['type'] == 'folder' %} - 📁 - {% endif %} - {{c['name']}} -
{{ type }} + {% for e in elements %} + {{e}} + {% endfor %} +
This center is empty
-{% endif %} {{ wtf.quick_form(form, action=url_for('action_center_delete'), diff --git a/ogcp/templates/actions/delete_room.html b/ogcp/templates/actions/delete_room.html index 3fa24cf..b4c3601 100644 --- a/ogcp/templates/actions/delete_room.html +++ b/ogcp/templates/actions/delete_room.html @@ -11,11 +11,11 @@

{{_('Delete room')}}

{% if children %} -

The following items will be deleted

+

The following room and its content will be deleted

- -{% for c in children %} +{% if children %} +{% for type, elements in children.items() %} + {% endfor %} +{% else %} + +{% endif %}
+ {% for x in ancestors %} {{x}} {% if not loop.last %} @@ -26,16 +26,20 @@
{{ type }} - {% if c['type'] == 'folder' %} - 📁 - {% endif %} - {{c['name']}} + {% for e in elements %} + {{e}} + {% endfor %}
This room is empty
{% endif %} diff --git a/ogcp/templates/actions/folder_delete.html b/ogcp/templates/actions/folder_delete.html index 8d497e8..0f58026 100644 --- a/ogcp/templates/actions/folder_delete.html +++ b/ogcp/templates/actions/folder_delete.html @@ -10,12 +10,11 @@

{{_('Delete folder')}}

-{% if children %} -

The following items will be deleted

+

The following folder and its content will be deleted

- -{% for c in children %} - - - -{% endfor %} +{% if children %} + {% for type, elements in children.items() %} + + + + + {% endfor %} +{% else %} + +{% endif %}
+ {% for x in ancestors %} {{x}} {% if not loop.last %} @@ -26,19 +25,22 @@
- {% if c['type'] == 'folder' %} - 📁 - {% endif %} - {{c['name']}} -
{{ type }} + {% for e in elements %} + {{e}} + {% endfor %} +
This folder is empty
-{% endif %} {{ wtf.quick_form(form, method='post', -- cgit v1.2.3-18-g5258