|
| 1 | +{% extends "admin/delete_confirmation.html" %} |
| 2 | +{% load i18n %} |
| 3 | + |
| 4 | +{% block extrastyle %} |
| 5 | +{{ block.super }} |
| 6 | +<style> |
| 7 | +#deactivating-warning .warning p { |
| 8 | + margin-top: 0px; |
| 9 | +} |
| 10 | +</style> |
| 11 | +{% endblock extrastyle %} |
| 12 | + |
| 13 | +{% block delete_confirm %} |
| 14 | +{% if deactivating_warning %} |
| 15 | +<div id="deactivating-warning"> |
| 16 | + <ul class="messagelist"> |
| 17 | + <li class="warning"> |
| 18 | + <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> |
| 19 | + <form> |
| 20 | + <input type="submit" class="button danger-btn" id="warning-ack" |
| 21 | + value="{% trans "I understand the risks, delete the device" %}"> |
| 22 | + <a class="button cancel-link">No, take me back</a> |
| 23 | + </form> |
| 24 | + </li> |
| 25 | + </ul> |
| 26 | +</div> |
| 27 | +{% endif %} |
| 28 | +<div id="delete-confirm-container" {% if deactivating_warning %}style="display:none;"{% endif %}> |
| 29 | + <p>{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} |
| 30 | + "{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}</p> |
| 31 | + {% include "admin/includes/object_delete_summary.html" %} |
| 32 | + <h2>{% translate "Objects" %}</h2> |
| 33 | + <ul id="deleted-objects">{{ deleted_objects|unordered_list }}</ul> |
| 34 | + <form method="post">{% csrf_token %} |
| 35 | + <div> |
| 36 | + <input type="hidden" name="post" value="yes"> |
| 37 | + <input type="hidden" name="force_delete" value="false"> |
| 38 | + {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} |
| 39 | + {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} |
| 40 | + <input type="submit" value="{% translate 'Yes, I’m sure' %}"> |
| 41 | + <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> |
| 42 | + </div> |
| 43 | + </form> |
| 44 | +</div> |
| 45 | +{% endblock %} |
| 46 | + |
| 47 | +{% block footer %} |
| 48 | +{{ block.super }} |
| 49 | +<script> |
| 50 | + (function ($) { |
| 51 | + $(document).ready(function () { |
| 52 | + $('#warning-ack').click(function (event) { |
| 53 | + event.preventDefault(); |
| 54 | + $('#deactivating-warning').slideUp('fast'); |
| 55 | + $('#delete-confirm-container').slideDown('fast'); |
| 56 | + $('input[name="force_delete"]').val('true'); |
| 57 | + }); |
| 58 | + }) |
| 59 | + })(django.jQuery); |
| 60 | +</script> |
| 61 | +{% endblock %} |
0 commit comments