mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 03:30:50 +02:00
Add custom desc on delete button
This commit is contained in:
parent
7a7000cf9d
commit
0ef72ad016
5 changed files with 37 additions and 5 deletions
|
@ -1339,6 +1339,18 @@ class DomainAdmin(ListHeaderAdmin):
|
||||||
# Table ordering
|
# Table ordering
|
||||||
ordering = ["name"]
|
ordering = ["name"]
|
||||||
|
|
||||||
|
def delete_view(self, request, object_id, extra_context=None):
|
||||||
|
"""
|
||||||
|
Custom delete_view to perform additional actions or customize the template.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Set the delete template to a custom one
|
||||||
|
self.delete_confirmation_template = "django/admin/domain_delete_confirmation.html"
|
||||||
|
|
||||||
|
response = super().delete_view(request, object_id, extra_context=extra_context)
|
||||||
|
|
||||||
|
return response
|
||||||
|
|
||||||
def changeform_view(self, request, object_id=None, form_url="", extra_context=None):
|
def changeform_view(self, request, object_id=None, form_url="", extra_context=None):
|
||||||
"""Custom changeform implementation to pass in context information"""
|
"""Custom changeform implementation to pass in context information"""
|
||||||
if extra_context is None:
|
if extra_context is None:
|
||||||
|
|
|
@ -76,7 +76,6 @@ function openInNewTab(el, removeAttribute = false){
|
||||||
// it will not be affected by the createPhantomModalFormButtons() function.
|
// it will not be affected by the createPhantomModalFormButtons() function.
|
||||||
let cancelButton = document.querySelector('button[name="_cancel_application_ineligible"]');
|
let cancelButton = document.querySelector('button[name="_cancel_application_ineligible"]');
|
||||||
if (cancelButton){
|
if (cancelButton){
|
||||||
console.log(`This is the previous val: ${previousValue}`)
|
|
||||||
cancelButton.addEventListener('click', function() {
|
cancelButton.addEventListener('click', function() {
|
||||||
// Revert the dropdown to its previous value
|
// Revert the dropdown to its previous value
|
||||||
statusDropdown.value = previousValue;
|
statusDropdown.value = previousValue;
|
||||||
|
|
|
@ -48,10 +48,10 @@
|
||||||
This action can be reversed, if needed.
|
This action can be reversed, if needed.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
|
Domain: <b>{{ original.requested_domain.name }}</b>
|
||||||
{# Acts as a <br> #}
|
{# Acts as a <br> #}
|
||||||
<div class="display-inline"></div>
|
<div class="display-inline"></div>
|
||||||
Domain: <b>{{ original.name }}</b>
|
New status: <b>{{ original.ApplicationStatus.INELIGIBLE|capfirst }}</b>
|
||||||
New status: <b>{{ original.State }}</b>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
Domain: <b>{{ original.name }}</b>
|
Domain: <b>{{ original.name }}</b>
|
||||||
{# Acts as a <br> #}
|
{# Acts as a <br> #}
|
||||||
<div class="display-inline"></div>
|
<div class="display-inline"></div>
|
||||||
New status: <b>{{ original.State.ON_HOLD }}</b>
|
New status: <b>{{ original.State.ON_HOLD|capfirst }}</b>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@
|
||||||
Domain: <b>{{ original.name }}</b>
|
Domain: <b>{{ original.name }}</b>
|
||||||
{# Acts as a <br> #}
|
{# Acts as a <br> #}
|
||||||
<div class="display-inline"></div>
|
<div class="display-inline"></div>
|
||||||
New status: <b>{{ original.State.DELETED }}</b>
|
New status: <b>{{ original.State.DELETED|capfirst }}</b>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
{% extends 'admin/delete_confirmation.html' %}
|
||||||
|
{% load i18n static %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
{# TODO modify the "Are you sure?" to the text content below.. #}
|
||||||
|
{% comment %}
|
||||||
|
<h3>Are you sure you want to remove this domain from the registry?</h3>
|
||||||
|
{% endcomment %}
|
||||||
|
<h2>Description</h2>
|
||||||
|
<p>When a domain is removed from the registry:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li>The domain and its subdomains won’t resolve in DNS. Any infrastructure (like websites) will go offline.</li>
|
||||||
|
<li>The domain will still appear in the registrar / admin.</li>
|
||||||
|
<li>Domain managers won’t be able to edit the domain.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>This action cannot be undone.</p>
|
||||||
|
|
||||||
|
{{ block.super }}
|
||||||
|
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue