Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
eb58a3bb
authored
Sep 10, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: internationalization fix
parent
36726958
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
circle/network/templates/network/confirm/base_delete.html
+1
-1
circle/network/views.py
+9
-8
No files found.
circle/network/templates/network/confirm/base_delete.html
View file @
eb58a3bb
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
{% trans "This action also
<strong>
removes
</strong>
the following" %}
{% trans "This action also
<strong>
removes
</strong>
the following" %}
{% for dep in deps %}
{% for dep in deps %}
<div
class=
"alert"
>
<div
class=
"alert"
>
<strong>
{
% trans dep.name %
}
</strong>
<strong>
{
{ dep.name }
}
</strong>
<ul
class=
""
>
<ul
class=
""
>
{{ dep.data|unordered_list }}
{{ dep.data|unordered_list }}
</ul>
</ul>
...
...
circle/network/views.py
View file @
eb58a3bb
...
@@ -188,12 +188,13 @@ class DomainDelete(DeleteView):
...
@@ -188,12 +188,13 @@ class DomainDelete(DeleteView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DomainDelete
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
DomainDelete
,
self
)
.
get_context_data
(
**
kwargs
)
records_from_hosts
=
_
(
u'Records from hosts'
)
deps
=
[]
deps
=
[]
# vlans
# vlans
vlans
=
Vlan
.
objects
.
filter
(
domain
=
self
.
object
)
.
all
()
vlans
=
Vlan
.
objects
.
filter
(
domain
=
self
.
object
)
.
all
()
if
len
(
vlans
)
>
0
:
if
len
(
vlans
)
>
0
:
deps
.
append
({
deps
.
append
({
'name'
:
'Vlans'
,
'name'
:
_
(
'Vlans'
)
,
'data'
:
vlans
'data'
:
vlans
})
})
...
@@ -201,7 +202,7 @@ class DomainDelete(DeleteView):
...
@@ -201,7 +202,7 @@ class DomainDelete(DeleteView):
hosts
=
Host
.
objects
.
filter
(
vlan__in
=
deps
[
0
][
'data'
])
hosts
=
Host
.
objects
.
filter
(
vlan__in
=
deps
[
0
][
'data'
])
if
len
(
hosts
)
>
0
:
if
len
(
hosts
)
>
0
:
deps
.
append
({
deps
.
append
({
'name'
:
'Hosts'
,
'name'
:
_
(
'Hosts'
)
,
'data'
:
hosts
'data'
:
hosts
})
})
...
@@ -212,7 +213,7 @@ class DomainDelete(DeleteView):
...
@@ -212,7 +213,7 @@ class DomainDelete(DeleteView):
)
)
if
len
(
records
)
>
0
:
if
len
(
records
)
>
0
:
deps
.
append
({
deps
.
append
({
'name'
:
'Records from hosts'
,
'name'
:
records_from_hosts
,
'data'
:
records
'data'
:
records
})
})
...
@@ -220,9 +221,9 @@ class DomainDelete(DeleteView):
...
@@ -220,9 +221,9 @@ class DomainDelete(DeleteView):
if
len
(
records
)
>
0
:
if
len
(
records
)
>
0
:
# to filter out doubles (records from hosts and domains)
# to filter out doubles (records from hosts and domains)
indexes
=
map
(
itemgetter
(
'name'
),
deps
)
indexes
=
map
(
itemgetter
(
'name'
),
deps
)
n
=
indexes
.
index
(
'Records from hosts'
)
if
len
(
indexes
)
>
0
else
0
n
=
indexes
.
index
(
records_from_hosts
)
if
len
(
indexes
)
>
0
else
0
deps
.
append
({
deps
.
append
({
'name'
:
'Records only from the domain'
,
'name'
:
u
'Records only from the domain'
,
'data'
:
records
.
exclude
(
pk__in
=
deps
[
n
][
'data'
])
if
n
>
0
'data'
:
records
.
exclude
(
pk__in
=
deps
[
n
][
'data'
])
if
n
>
0
else
records
else
records
})
})
...
@@ -394,7 +395,7 @@ class HostDelete(DeleteView):
...
@@ -394,7 +395,7 @@ class HostDelete(DeleteView):
records
=
Record
.
objects
.
filter
(
host
=
self
.
object
)
.
all
()
records
=
Record
.
objects
.
filter
(
host
=
self
.
object
)
.
all
()
if
records
:
if
records
:
deps
.
append
({
deps
.
append
({
'name'
:
'Records'
,
'name'
:
_
(
'Records'
)
,
'data'
:
records
'data'
:
records
})
})
...
@@ -575,7 +576,7 @@ class VlanDelete(DeleteView):
...
@@ -575,7 +576,7 @@ class VlanDelete(DeleteView):
hosts
=
Host
.
objects
.
filter
(
vlan
=
self
.
object
)
.
all
()
hosts
=
Host
.
objects
.
filter
(
vlan
=
self
.
object
)
.
all
()
if
len
(
hosts
)
>
0
:
if
len
(
hosts
)
>
0
:
deps
.
append
({
deps
.
append
({
'name'
:
'Hosts'
,
'name'
:
_
(
'Hosts'
)
,
'data'
:
hosts
'data'
:
hosts
})
})
...
@@ -583,7 +584,7 @@ class VlanDelete(DeleteView):
...
@@ -583,7 +584,7 @@ class VlanDelete(DeleteView):
records
=
Record
.
objects
.
filter
(
host__in
=
deps
[
0
][
'data'
])
records
=
Record
.
objects
.
filter
(
host__in
=
deps
[
0
][
'data'
])
if
len
(
records
)
>
0
:
if
len
(
records
)
>
0
:
deps
.
append
({
deps
.
append
({
'name'
:
'Records'
,
'name'
:
_
(
'Records'
)
,
'data'
:
records
'data'
:
records
})
})
...
...
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