-
-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Allowed deleting device with "deactivating" config status #949
Fixes #949
- Loading branch information
Showing
5 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
openwisp_controller/config/templates/admin/config/device/delete_confirmation.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{% extends "admin/delete_confirmation.html" %} | ||
{% load i18n %} | ||
|
||
{% block extrastyle %} | ||
{{ block.super }} | ||
<style> | ||
#deactivating-warning .warning p { | ||
margin-top: 0px; | ||
} | ||
</style> | ||
{% endblock extrastyle %} | ||
|
||
{% block delete_confirm %} | ||
{% if deactivating_warning %} | ||
<div id="deactivating-warning"> | ||
<ul class="messagelist"> | ||
<li class="warning"> | ||
<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> | ||
<form> | ||
<input type="submit" class="button danger-btn" id="warning-ack" | ||
value="{% trans "I understand the risks, delete the device" %}"> | ||
<a class="button cancel-link">No, take me back</a> | ||
</form> | ||
</li> | ||
</ul> | ||
</div> | ||
{% endif %} | ||
<div id="delete-confirm-container" {% if deactivating_warning %}style="display:none;"{% endif %}> | ||
<p>{% blocktranslate with escaped_object=object %}Are you sure you want to delete the {{ object_name }} | ||
"{{ escaped_object }}"? All of the following related items will be deleted:{% endblocktranslate %}</p> | ||
{% include "admin/includes/object_delete_summary.html" %} | ||
<h2>{% translate "Objects" %}</h2> | ||
<ul id="deleted-objects">{{ deleted_objects|unordered_list }}</ul> | ||
<form method="post">{% csrf_token %} | ||
<div> | ||
<input type="hidden" name="post" value="yes"> | ||
<input type="hidden" name="force_delete" value="false"> | ||
{% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %} | ||
{% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %} | ||
<input type="submit" value="{% translate 'Yes, I’m sure' %}"> | ||
<a href="#" class="button cancel-link">{% translate "No, take me back" %}</a> | ||
</div> | ||
</form> | ||
</div> | ||
{% endblock %} | ||
|
||
{% block footer %} | ||
{{ block.super }} | ||
<script> | ||
(function ($) { | ||
$(document).ready(function () { | ||
$('#warning-ack').click(function (event) { | ||
event.preventDefault(); | ||
$('#deactivating-warning').slideUp('fast'); | ||
$('#delete-confirm-container').slideDown('fast'); | ||
$('input[name="force_delete"]').val('true'); | ||
}); | ||
}) | ||
})(django.jQuery); | ||
</script> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters