Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
f5cfd09c
Kaydet (Commit)
f5cfd09c
authored
Tem 28, 2014
tarafından
Nick Sandford
Kaydeden (comit)
Tim Graham
Eyl 30, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #7361 -- Added cancel link to admin delete views.
üst
a407b846
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
base.css
django/contrib/admin/static/admin/css/base.css
+6
-2
delete_confirmation.html
...go/contrib/admin/templates/admin/delete_confirmation.html
+1
-0
delete_selected_confirmation.html
...b/admin/templates/admin/delete_selected_confirmation.html
+1
-0
tests.py
tests/admin_views/tests.py
+31
-0
No files found.
django/contrib/admin/static/admin/css/base.css
Dosyayı görüntüle @
f5cfd09c
...
...
@@ -410,7 +410,7 @@ table.orderable-initalized .order-cell, body>tr>td.order-cell {
/* FORM DEFAULTS */
input
,
textarea
,
select
,
.form-row
p
{
input
,
textarea
,
select
,
.form-row
p
,
form
.button
{
margin
:
2px
0
;
padding
:
2px
3px
;
vertical-align
:
middle
;
...
...
@@ -430,7 +430,7 @@ textarea, select, .vTextField {
/* FORM BUTTONS */
.button
,
input
[
type
=
submit
],
input
[
type
=
button
],
.submit-row
input
{
.button
,
input
[
type
=
submit
],
input
[
type
=
button
],
.submit-row
input
,
a
.button
{
background
:
#fff
url(../img/nav-bg.gif)
bottom
repeat-x
;
padding
:
3px
5px
;
color
:
black
;
...
...
@@ -438,6 +438,10 @@ textarea, select, .vTextField {
border-color
:
#ddd
#aaa
#aaa
#ddd
;
}
a
.button
{
padding
:
4px
5px
;
}
.button
:active
,
input
[
type
=
submit
]
:active
,
input
[
type
=
button
]
:active
{
background-image
:
url(../img/nav-bg-reverse.gif)
;
background-position
:
top
;
...
...
django/contrib/admin/templates/admin/delete_confirmation.html
Dosyayı görüntüle @
f5cfd09c
...
...
@@ -37,6 +37,7 @@
<div>
<input
type=
"hidden"
name=
"post"
value=
"yes"
/>
<input
type=
"submit"
value=
"{% trans "
Yes
,
I
'
m
sure
"
%}"
/>
<a
href=
"#"
onclick=
"window.history.back(); return false;"
class=
"button cancel-link"
>
{% trans "No, take me back" %}
</a>
</div>
</form>
{% endif %}
...
...
django/contrib/admin/templates/admin/delete_selected_confirmation.html
Dosyayı görüntüle @
f5cfd09c
...
...
@@ -42,6 +42,7 @@
<input
type=
"hidden"
name=
"action"
value=
"delete_selected"
/>
<input
type=
"hidden"
name=
"post"
value=
"yes"
/>
<input
type=
"submit"
value=
"{% trans "
Yes
,
I
'
m
sure
"
%}"
/>
<a
href=
"#"
onclick=
"window.history.back(); return false;"
class=
"button cancel-link"
>
{% trans "No, take me back" %}
</a>
</div>
</form>
{% endif %}
...
...
tests/admin_views/tests.py
Dosyayı görüntüle @
f5cfd09c
...
...
@@ -3814,6 +3814,37 @@ class SeleniumAdminViewsFirefoxTests(AdminSeleniumWebDriverTestCase):
self
.
selenium
.
find_element_by_id
(
'id_start_date_0'
)
)
def
test_cancel_delete_confirmation
(
self
):
"Cancelling the deletion of an object takes the user back one page."
pizza
=
Pizza
.
objects
.
create
(
name
=
"Panucci's Double Cheese"
)
url
=
reverse
(
'admin:admin_views_pizza_change'
,
args
=
(
pizza
.
id
,))
full_url
=
'
%
s
%
s'
%
(
self
.
live_server_url
,
url
)
self
.
admin_login
(
username
=
'super'
,
password
=
'secret'
,
login_url
=
'/test_admin/admin/'
)
self
.
selenium
.
get
(
full_url
)
self
.
selenium
.
find_element_by_class_name
(
'deletelink'
)
.
click
()
self
.
selenium
.
find_element_by_class_name
(
'cancel-link'
)
.
click
()
self
.
assertEqual
(
self
.
selenium
.
current_url
,
full_url
)
self
.
assertEqual
(
Pizza
.
objects
.
count
(),
1
)
def
test_cancel_delete_related_confirmation
(
self
):
"""
Cancelling the deletion of an object with relations takes the user back
one page.
"""
pizza
=
Pizza
.
objects
.
create
(
name
=
"Panucci's Double Cheese"
)
topping1
=
Topping
.
objects
.
create
(
name
=
"Cheddar"
)
topping2
=
Topping
.
objects
.
create
(
name
=
"Mozzarella"
)
pizza
.
toppings
.
add
(
topping1
,
topping2
)
url
=
reverse
(
'admin:admin_views_pizza_change'
,
args
=
(
pizza
.
id
,))
full_url
=
'
%
s
%
s'
%
(
self
.
live_server_url
,
url
)
self
.
admin_login
(
username
=
'super'
,
password
=
'secret'
,
login_url
=
'/test_admin/admin/'
)
self
.
selenium
.
get
(
full_url
)
self
.
selenium
.
find_element_by_class_name
(
'deletelink'
)
.
click
()
self
.
selenium
.
find_element_by_class_name
(
'cancel-link'
)
.
click
()
self
.
assertEqual
(
self
.
selenium
.
current_url
,
full_url
)
self
.
assertEqual
(
Pizza
.
objects
.
count
(),
1
)
self
.
assertEqual
(
Topping
.
objects
.
count
(),
2
)
class
SeleniumAdminViewsChromeTests
(
SeleniumAdminViewsFirefoxTests
):
webdriver_class
=
'selenium.webdriver.chrome.webdriver.WebDriver'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment