summaryrefslogtreecommitdiffstats
path: root/ogcp/templates/actions
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-02-05 10:48:12 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-02-05 11:48:35 +0100
commit6153ca426f9f880c70564ecb2d5346d64c2802eb (patch)
treeb132e076715caf0ecd46aba52672cb4e808a999c /ogcp/templates/actions
parent6a134b63372311706f174516a45ad2af8c7ff225 (diff)
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.)
Diffstat (limited to 'ogcp/templates/actions')
-rw-r--r--ogcp/templates/actions/delete_center.html30
-rw-r--r--ogcp/templates/actions/delete_room.html18
-rw-r--r--ogcp/templates/actions/folder_delete.html30
3 files changed, 43 insertions, 35 deletions
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 %}
<h1 class="m-5">{{_('Delete center')}}</h1>
-{% if children %}
-<p class="text-left mx-5">The following items will be deleted</p>
+<p class="text-left mx-5">The following center and its content will be deleted</p>
<table class="table table-hover mx-5">
<thead class="thead-light">
<tr>
-<th>
+<th colspan="2">
{% for x in ancestors %}
{{x}}
{% if not loop.last %}
@@ -25,19 +24,22 @@
</tr>
</thead>
<tbody class="text-left">
-{% for c in children %}
- <tr>
- <td>
- {% if c['type'] == 'folder' %}
- &#x1F4C1;
- {% endif %}
- {{c['name']}}
- </td>
- </tr>
-{% endfor %}
+{% if children %}
+ {% for type, elements in children.items() %}
+ <tr>
+ <th>{{ type }}</th>
+ <td>
+ {% for e in elements %}
+ {{e}}
+ {% endfor %}
+ </td>
+ </tr>
+ {% endfor %}
+{% else %}
+ <tr><td>This center is empty</td></tr>
+{% endif %}
</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 3fa24cf..b4c3601 100644
--- a/ogcp/templates/actions/delete_room.html
+++ b/ogcp/templates/actions/delete_room.html
@@ -11,11 +11,11 @@
<h1 class="m-5">{{_('Delete room')}}</h1>
{% if children %}
-<p class="text-left mx-5">The following items will be deleted</p>
+<p class="text-left mx-5">The following room and its content will be deleted</p>
<table class="table table-hover mx-5">
<thead class="thead-light">
<tr>
-<th>
+<th colspan="2">
{% for x in ancestors %}
{{x}}
{% if not loop.last %}
@@ -26,16 +26,20 @@
</tr>
</thead>
<tbody class="text-left">
-{% for c in children %}
+{% if children %}
+{% for type, elements in children.items() %}
<tr>
+ <th>{{ type }}</th>
<td>
- {% if c['type'] == 'folder' %}
- &#x1F4C1;
- {% endif %}
- {{c['name']}}
+ {% for e in elements %}
+ {{e}}
+ {% endfor %}
</td>
</tr>
{% endfor %}
+{% else %}
+ <tr><td>This room is empty</td></tr>
+{% endif %}
</tbody>
</table>
{% 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 @@
<h1 class="m-5">{{_('Delete folder')}}</h1>
-{% if children %}
-<p class="text-left mx-5">The following items will be deleted</p>
+<p class="text-left mx-5">The following folder and its content will be deleted</p>
<table class="table table-hover mx-5">
<thead class="thead-light">
<tr>
-<th>
+<th colspan="2">
{% for x in ancestors %}
{{x}}
{% if not loop.last %}
@@ -26,19 +25,22 @@
</tr>
</thead>
<tbody class="text-left">
-{% for c in children %}
- <tr>
- <td>
- {% if c['type'] == 'folder' %}
- &#x1F4C1;
- {% endif %}
- {{c['name']}}
- </td>
- </tr>
-{% endfor %}
+{% if children %}
+ {% for type, elements in children.items() %}
+ <tr>
+ <th>{{ type }}</th>
+ <td>
+ {% for e in elements %}
+ {{e}}
+ {% endfor %}
+ </td>
+ </tr>
+ {% endfor %}
+{% else %}
+ <tr><td>This folder is empty</td></tr>
+{% endif %}
</tbody>
</table>
-{% endif %}
{{ wtf.quick_form(form,
method='post',