|
1 | 1 | {% extends "admin/delete_selected_confirmation.html" %} |
2 | 2 | {% load i18n l10n admin_urls static %} |
3 | 3 |
|
| 4 | +{% block extrastyle %} |
| 5 | +{{ block.super }} |
| 6 | +<link rel="stylesheet" type="text/css" href="{% static 'config/css/device-delete-confirmation.css' %}" /> |
| 7 | +{% endblock extrastyle %} |
| 8 | + |
4 | 9 | {% block content %} |
5 | 10 | {% if perms_lacking %} |
6 | | - {% if perms_lacking|first == 'active_devices' %} |
7 | | - <p>{% blocktranslate %}You have selected the following active device{{ model_count | pluralize }} to delete:{% endblocktranslate %}</p> |
8 | | - <ul>{{ deletable_objects|first|unordered_list }}</ul> |
9 | | - <p>{% blocktrans %}It is required to flag the device as deactivated before deleting the device. If the device has configuration, then wait till the configuration status changes to "deactivated" before deleting the device.{% endblocktrans %}</p> |
10 | | - {% else %} |
11 | | - <p>{% blocktranslate %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}</p> |
12 | | - <ul>{{ perms_lacking|unordered_list }}</ul> |
13 | | - {% endif %} |
| 11 | + <p>{% blocktranslate %}Deleting the selected {{ objects_name }} would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}</p> |
| 12 | + <ul>{{ perms_lacking|unordered_list }}</ul> |
14 | 13 | {% elif protected %} |
15 | 14 | <p>{% blocktranslate %}Deleting the selected {{ objects_name }} would require deleting the following protected related objects:{% endblocktranslate %}</p> |
16 | 15 | <ul>{{ protected|unordered_list }}</ul> |
17 | 16 | {% else %} |
18 | | - <p>{% blocktranslate %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktranslate %}</p> |
19 | | - {% include "admin/includes/object_delete_summary.html" %} |
20 | | - <h2>{% translate "Objects" %}</h2> |
21 | | - {% for deletable_object in deletable_objects %} |
22 | | - <ul>{{ deletable_object|unordered_list }}</ul> |
23 | | - {% endfor %} |
24 | | - <form method="post">{% csrf_token %} |
25 | | - <div> |
26 | | - {% for obj in queryset %} |
27 | | - <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}"> |
28 | | - {% endfor %} |
29 | | - <input type="hidden" name="action" value="delete_selected"> |
30 | | - <input type="hidden" name="post" value="yes"> |
31 | | - <input type="submit" value="{% translate 'Yes, I’m sure' %}"> |
32 | | - <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> |
| 17 | + {% if active_devices %} |
| 18 | + <div id="deactivating-warning"> |
| 19 | + <ul class="messagelist"> |
| 20 | + <li class="warning"> |
| 21 | + <p> |
| 22 | + {% blocktrans count counter=active_devices|length %} |
| 23 | + The following device you selected for deletion is not deactivated |
| 24 | + (either it is active or its configuration status is still "deactivating"): |
| 25 | + {% plural %} |
| 26 | + The following devices you selected for deletion are not deactivated |
| 27 | + (either they are active or their configuration status is still "deactivating"): |
| 28 | + {% endblocktrans %} |
| 29 | + </p> |
| 30 | + <ul>{{ active_devices|unordered_list }}</ul> |
| 31 | + <p> |
| 32 | + {% blocktranslate count counter=active_devices|length %} |
| 33 | + If you wish to remove the configuration from the device, please wait until its |
| 34 | + configuration status changes to "deactivated". Proceeding will delete the device |
| 35 | + from OpenWISP without ensuring its configuration has been removed. |
| 36 | + {% plural %} |
| 37 | + If you wish to remove the configurations from the devices, please wait until their |
| 38 | + configuration status change to "deactivated." Proceeding will delete the devices |
| 39 | + from OpenWISP without ensuring their configurations have been removed. |
| 40 | + {% endblocktranslate %} |
| 41 | + </p> |
| 42 | + <form> |
| 43 | + <input type="submit" class="button danger-btn" id="warning-ack" |
| 44 | + value="{% trans "I understand the risks, delete the device" %}"> |
| 45 | + <a class="button cancel-link">No, take me back</a> |
| 46 | + </form> |
| 47 | + </li> |
| 48 | + </ul> |
| 49 | + </div> |
| 50 | + {% endif %} |
| 51 | + <div id="delete-confirm-container" {% if active_devices %}style="display:none;"{% endif %}> |
| 52 | + <p>{% blocktranslate %}Are you sure you want to delete the selected {{ objects_name }}? All of the following objects and their related items will be deleted:{% endblocktranslate %}</p> |
| 53 | + {% include "admin/includes/object_delete_summary.html" %} |
| 54 | + <h2>{% translate "Objects" %}</h2> |
| 55 | + {% for deletable_object in deletable_objects %} |
| 56 | + <ul>{{ deletable_object|unordered_list }}</ul> |
| 57 | + {% endfor %} |
| 58 | + <form method="post">{% csrf_token %} |
| 59 | + <div> |
| 60 | + {% for obj in queryset %} |
| 61 | + <input type="hidden" name="{{ action_checkbox_name }}" value="{{ obj.pk|unlocalize }}"> |
| 62 | + {% endfor %} |
| 63 | + <input type="hidden" name="action" value="delete_selected"> |
| 64 | + <input type="hidden" name="post" value="yes"> |
| 65 | + <input type="submit" value="{% translate 'Yes, I’m sure' %}"> |
| 66 | + <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> |
| 67 | + </div> |
| 68 | + </form> |
33 | 69 | </div> |
34 | | - </form> |
35 | 70 | {% endif %} |
36 | 71 | {% endblock %} |
| 72 | + |
| 73 | +{% block footer %} |
| 74 | +{{ block.super }} |
| 75 | +<script type="text/javascript" src="{% static 'config/js/device-delete-confirmation.js' %}"></script> |
| 76 | +{% endblock %} |
0 commit comments