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
19f66acd
authored
Aug 27, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: translation support and minor change to confirmation
parent
c485b7d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
12 deletions
+14
-12
network/templates/network/confirm/base_delete.html
+11
-9
network/views.py
+3
-3
No files found.
network/templates/network/confirm/base_delete.html
View file @
19f66acd
...
...
@@ -4,18 +4,21 @@
{% block content %}
<div
class=
"page-header"
>
<h2>
Are you sure you want to delete
<strong>
"{% if to_delete %}{{ to_delete }}{% else %}{{ object }}{% endif %}"
</strong>
?
</h2>
<h2>
{% blocktrans %}
Are you sure you want to delete
<strong>
"{{ object }}"
</strong>
?
{% endblocktrans %}
</h2>
</div>
<form
action=
""
method=
"post"
>
{% csrf_token %}
{% if deps %}
<div
class=
"alert alert-warning"
>
This action also
<strong>
removes
</strong>
the following
{% trans "This action also
<strong>
removes
</strong>
the following" %}
{% for dep in deps %}
<div
class=
"alert"
>
<strong>
{
{ dep.name }
}
</strong>
<strong>
{
% trans dep.name %
}
</strong>
<ul
class=
""
>
{{ dep.data|unordered_list }}
</ul>
...
...
@@ -24,20 +27,19 @@
</div>
{% else %}
<div
class=
"alert alert-success"
>
No dependencies, safe to delete!
{% trans 'No dependencies, "safe" to delete!' %}
</div>
{% endif %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
<input
type=
"hidden"
value=
"{{ request.GET.from }}"
name=
"next"
/>
{% if confirmation %}
<label><p>
If you are really sure, type in the object's name!
{% trans "If you are really sure, type in the object's name!" %}
<input
type=
"text"
name=
"confirm"
class=
"form-control"
placeholder=
"{{ object }}"
/>
</p></label>
{% else %}
{% endif %}
<input
type=
"submit"
class=
"btn btn-danger btn-lg pull-right"
value=
"
Yes delete it!"
/>
<input
type=
"submit"
class=
"btn btn-danger btn-lg pull-right"
value=
"
{% trans "
Yes
,
delete
it
!"
%}"
/>
</form>
{% endblock %}
network/views.py
View file @
19f66acd
...
...
@@ -93,9 +93,9 @@ class BlacklistDelete(DeleteView):
context
=
super
(
BlacklistDelete
,
self
)
.
get_context_data
(
**
kwargs
)
if
'pk'
in
self
.
kwargs
:
to_delete
=
Blacklist
.
objects
.
get
(
pk
=
self
.
kwargs
[
'pk'
])
context
[
'
to_delete
'
]
=
"
%
s -
%
s -
%
s"
%
(
to_delete
.
ipv4
,
to_delete
.
reason
,
to_delete
.
type
)
context
[
'
object
'
]
=
"
%
s -
%
s -
%
s"
%
(
to_delete
.
ipv4
,
to_delete
.
reason
,
to_delete
.
type
)
return
context
def
get_success_url
(
self
):
...
...
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