|
6 | 6 | <link rel="stylesheet" type="text/css" href="{% static 'config/css/device-delete-confirmation.css' %}" /> |
7 | 7 | {% endblock extrastyle %} |
8 | 8 |
|
9 | | -{% block delete_confirm %} |
10 | | -{% if deactivating_warning %} |
11 | | -<div id="deactivating-warning"> |
12 | | - <ul class="messagelist"> |
13 | | - <li class="warning"> |
14 | | - <p>{% trans 'The device is still in the deactivating state, meaning its configuration is still present on the device. If you wish to remove the configuration from the device, please wait until the config status changes to "deactivated". Proceeding will delete the device from OpenWISP without ensuring its configuration has been removed.' %}</p> |
15 | | - <form> |
16 | | - <input type="submit" class="button danger-btn" id="warning-ack" |
17 | | - value="{% trans 'I understand the risks, delete the device' %}"> |
18 | | - <a class="button cancel-link">{% trans 'No, take me back' %}</a> |
19 | | - </form> |
20 | | - </li> |
| 9 | +{% block content %} |
| 10 | +{% if perms_lacking %} |
| 11 | + <p>{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would result in deleting related objects, but your account doesn't have permission to delete the following types of objects:{% endblocktranslate %}</p> |
| 12 | + <ul> |
| 13 | + {% for obj in perms_lacking %} |
| 14 | + <li>{{ obj }}</li> |
| 15 | + {% endfor %} |
21 | 16 | </ul> |
22 | | -</div> |
| 17 | +{% elif protected %} |
| 18 | + <p>{% blocktranslate with escaped_object=object %}Deleting the {{ object_name }} '{{ escaped_object }}' would require deleting the following protected related objects:{% endblocktranslate %}</p> |
| 19 | + <ul> |
| 20 | + {% for obj in protected %} |
| 21 | + <li>{{ obj }}</li> |
| 22 | + {% endfor %} |
| 23 | + </ul> |
| 24 | +{% else %} |
| 25 | + {% if deactivating_warning %} |
| 26 | + <div id="deactivating-warning"> |
| 27 | + <ul class="messagelist"> |
| 28 | + <li class="warning"> |
| 29 | + <p>{% translate 'The device is still in the deactivating state, meaning its configuration is still present on the device. If you wish to remove the configuration from the device, please wait until the config status changes to "deactivated". Proceeding will delete the device from OpenWISP without ensuring its configuration has been removed.' %}</p> |
| 30 | + <form> |
| 31 | + <input type="submit" class="button danger-btn" id="warning-ack" |
| 32 | + value="{% translate 'I understand the risks, delete the device' %}"> |
| 33 | + <a class="button cancel-link">{% translate 'No, take me back' %}</a> |
| 34 | + </form> |
| 35 | + </li> |
| 36 | + </ul> |
| 37 | + </div> |
| 38 | + {% endif %} |
| 39 | + <div id="delete-confirm-container" {% if deactivating_warning %}style="display:none;"{% endif %}> |
| 40 | + <p>{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} |
| 41 | + "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}</p> |
| 42 | + {% include "admin/includes/object_delete_summary.html" %} |
| 43 | + <h2>{% translate "Objects" %}</h2> |
| 44 | + <ul id="deleted-objects">{{ deleted_objects|unordered_list }}</ul> |
| 45 | + <form method="post">{% csrf_token %} |
| 46 | + <div> |
| 47 | + <input type="hidden" name="post" value="yes"> |
| 48 | + {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} |
| 49 | + {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} |
| 50 | + <input type="submit" value="{% translate 'Yes, I’m sure' %}"> |
| 51 | + {% if deactivating_warning %}<input type="hidden" name="force_delete" value="false">{% endif %} |
| 52 | + <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> |
| 53 | + </div> |
| 54 | + </form> |
| 55 | + </div> |
23 | 56 | {% endif %} |
24 | | -<div id="delete-confirm-container" {% if deactivating_warning %}style="display:none;"{% endif %}> |
25 | | - <p>{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} |
26 | | - "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}</p> |
27 | | - {% include "admin/includes/object_delete_summary.html" %} |
28 | | - <h2>{% translate "Objects" %}</h2> |
29 | | - <ul id="deleted-objects">{{ deleted_objects|unordered_list }}</ul> |
30 | | - <form method="post">{% csrf_token %} |
31 | | - <div> |
32 | | - <input type="hidden" name="post" value="yes"> |
33 | | - {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} |
34 | | - {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} |
35 | | - <input type="submit" value="{% translate 'Yes, I’m sure' %}"> |
36 | | - {% if deactivating_warning %}<input type="hidden" name="force_delete" value="false">{% endif %} |
37 | | - <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> |
38 | | - </div> |
39 | | - </form> |
40 | | -</div> |
41 | 57 | {% endblock %} |
42 | 58 |
|
43 | 59 | {% block footer %} |
|
0 commit comments