summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/actions
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-02-01 10:58:07 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-01 11:20:04 +0100
commit85a22b9b8137a26869494c8b908c03321dc47846 (patch)
tree06906dd76485b5bf117f8d64db9055b199920036 /ogcp/templates/actions
parent556e06cc3d159c9b1b207a55d3f35f7d0ba048c6 (diff)
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
Diffstat (limited to 'ogcp/templates/actions')
-rw-r--r--ogcp/templates/actions/delete_center.html29
-rw-r--r--ogcp/templates/actions/delete_room.html30
-rw-r--r--ogcp/templates/actions/folder_delete.html33
3 files changed, 85 insertions, 7 deletions
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 %}
<h1 class="m-5">{{_('Delete center')}}</h1>
+{% if children %}
+<p class="text-left mx-5">The following items will be deleted</p>
+<table class="table table-hover mx-5">
+<thead class="thead-light">
+<tr>
+<th>
+{% for x in ancestors %}
+ {{x}}
+ {% if not loop.last %}
+ >
+ {% endif %}
+{% endfor %}
+</th>
+</tr>
+</thead>
+<tbody class="text-left">
+{% for c in children %}
+ <tr>
+ <td>
+ {% if c['type'] == 'folder' %}
+ &#x1F4C1;
+ {% endif %}
+ {{c['name']}}
+ </td>
+ </tr>
+{% endfor %}
+</tbody>
+</table>
+{% 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 @@
<h1 class="m-5">{{_('Delete room')}}</h1>
+{% if children %}
+<p class="text-left mx-5">The following items will be deleted</p>
+<table class="table table-hover mx-5">
+<thead class="thead-light">
+<tr>
+<th>
+{% for x in ancestors %}
+ {{x}}
+ {% if not loop.last %}
+ >
+ {% endif %}
+{% endfor %}
+</th>
+</tr>
+</thead>
+<tbody class="text-left">
+{% for c in children %}
+ <tr>
+ <td>
+ {% if c['type'] == 'folder' %}
+ &#x1F4C1;
+ {% endif %}
+ {{c['name']}}
+ </td>
+ </tr>
+{% endfor %}
+</tbody>
+</table>
+{% 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 @@
<h1 class="m-5">{{_('Delete folder')}}</h1>
-<table class="table">
- <tbody>
- {% for content in folder_content %}
+{% if children %}
+<p class="text-left mx-5">The following items will be deleted</p>
+<table class="table table-hover mx-5">
+<thead class="thead-light">
+<tr>
+<th>
+{% for x in ancestors %}
+ {{x}}
+ {% if not loop.last %}
+ >
+ {% endif %}
+{% endfor %}
+</th>
+</tr>
+</thead>
+<tbody class="text-left">
+{% for c in children %}
<tr>
- <th scope="row">{{ content['type'] }}</th>
- <td>{{ content['name'] }}</td>
+ <td>
+ {% if c['type'] == 'folder' %}
+ &#x1F4C1;
+ {% endif %}
+ {{c['name']}}
+ </td>
</tr>
- {% endfor %}
- </tbody>
+{% endfor %}
+</tbody>
</table>
+{% endif %}
{{ wtf.quick_form(form,
method='post',