Code

Ticket #7361: 7361.admin-cancel-delete.diff

File 7361.admin-cancel-delete.diff, 1.9 KB (added by julien, 3 years ago)

Cancel action as a link

Line 
1diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css
2index 23fddaf..22804bb 100644
3--- a/django/contrib/admin/static/admin/css/base.css
4+++ b/django/contrib/admin/static/admin/css/base.css
5@@ -453,6 +453,12 @@ input[type=text], input[type=password], textarea, select, .vTextField {
6        opacity: 0.4;
7 }
8 
9+form a.cancel-that {
10+    font-size: 11px;
11+    margin: 2px 0px;
12+    padding: 3px 5px;
13+    vertical-align: middle;
14+}
15 
16 /* MODULES */
17 
18diff --git a/django/contrib/admin/templates/admin/delete_confirmation.html b/django/contrib/admin/templates/admin/delete_confirmation.html
19index 0e6d47e..76a6cd0 100644
20--- a/django/contrib/admin/templates/admin/delete_confirmation.html
21+++ b/django/contrib/admin/templates/admin/delete_confirmation.html
22@@ -35,7 +35,7 @@
23     <form action="" method="post">{% csrf_token %}
24     <div>
25     <input type="hidden" name="post" value="yes" />
26-    <input type="submit" value="{% trans "Yes, I'm sure" %}" />
27+    <input type="submit" value="{% trans "Yes, I'm sure" %}" /> <a class="cancel-that" href="../">{% trans "No, cancel that." %}</a>
28     </div>
29     </form>
30 {% endif %}
31diff --git a/django/contrib/admin/templates/admin/delete_selected_confirmation.html b/django/contrib/admin/templates/admin/delete_selected_confirmation.html
32index 127519b..9a46d81 100644
33--- a/django/contrib/admin/templates/admin/delete_selected_confirmation.html
34+++ b/django/contrib/admin/templates/admin/delete_selected_confirmation.html
35@@ -40,7 +40,7 @@
36     {% endfor %}
37     <input type="hidden" name="action" value="delete_selected" />
38     <input type="hidden" name="post" value="yes" />
39-    <input type="submit" value="{% trans "Yes, I'm sure" %}" />
40+    <input type="submit" value="{% trans "Yes, I'm sure" %}" /> <a class="cancel-that" href="">{% trans "No, cancel that." %}</a>
41     </div>
42     </form>
43 {% endif %}