From 85a22b9b8137a26869494c8b908c03321dc47846 Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Thu, 1 Feb 2024 10:58:07 +0100 Subject: improve delete confirmation page In delete-center, delete-room and delete-folder confirmation pages, show the ancestors of the items about to delete. Likewise, show the items it contains. For example, if user is about to delete a room, confirmation page will display in which center it is contained and the clients and folder it has inside --- ogcp/templates/actions/delete_center.html | 29 +++++++++++++++++++++++++++ ogcp/templates/actions/delete_room.html | 30 ++++++++++++++++++++++++++++ ogcp/templates/actions/folder_delete.html | 33 ++++++++++++++++++++++++------- 3 files changed, 85 insertions(+), 7 deletions(-) (limited to 'ogcp/templates') diff --git a/ogcp/templates/actions/delete_center.html b/ogcp/templates/actions/delete_center.html index 6fef1f6..af89364 100644 --- a/ogcp/templates/actions/delete_center.html +++ b/ogcp/templates/actions/delete_center.html @@ -9,6 +9,35 @@ {% block content %}

{{_('Delete center')}}

+{% if children %} +

The following items will be deleted

+ + + + + + + +{% for c in children %} + + + +{% endfor %} + +
+{% for x in ancestors %} + {{x}} + {% if not loop.last %} + > + {% endif %} +{% endfor %} +
+ {% if c['type'] == 'folder' %} + 📁 + {% endif %} + {{c['name']}} +
+{% 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 aa57368..3fa24cf 100644 --- a/ogcp/templates/actions/delete_room.html +++ b/ogcp/templates/actions/delete_room.html @@ -10,6 +10,36 @@

{{_('Delete room')}}

+{% if children %} +

The following items will be deleted

+ + + + + + + +{% for c in children %} + + + +{% endfor %} + +
+{% for x in ancestors %} + {{x}} + {% if not loop.last %} + > + {% endif %} +{% endfor %} +
+ {% if c['type'] == 'folder' %} + 📁 + {% endif %} + {{c['name']}} +
+{% endif %} + {{ wtf.quick_form(form, action=url_for('action_room_delete'), method='post', diff --git a/ogcp/templates/actions/folder_delete.html b/ogcp/templates/actions/folder_delete.html index 78fc136..8d497e8 100644 --- a/ogcp/templates/actions/folder_delete.html +++ b/ogcp/templates/actions/folder_delete.html @@ -10,16 +10,35 @@

{{_('Delete folder')}}

- - - {% for content in folder_content %} +{% if children %} +

The following items will be deleted

+
+ + + + + + +{% for c in children %} - - + - {% endfor %} - +{% endfor %} +
+{% for x in ancestors %} + {{x}} + {% if not loop.last %} + > + {% endif %} +{% endfor %} +
{{ content['type'] }}{{ content['name'] }} + {% if c['type'] == 'folder' %} + 📁 + {% endif %} + {{c['name']}} +
+{% endif %} {{ wtf.quick_form(form, method='post', -- cgit v1.2.3-18-g5258