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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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 @@
...
@@ -4,18 +4,21 @@
{% block content %}
{% block content %}
<div
class=
"page-header"
>
<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>
</div>
<form
action=
""
method=
"post"
>
{% csrf_token %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
{% if deps %}
{% if deps %}
<div
class=
"alert alert-warning"
>
<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 %}
{% for dep in deps %}
<div
class=
"alert"
>
<div
class=
"alert"
>
<strong>
{
{ dep.name }
}
</strong>
<strong>
{
% trans dep.name %
}
</strong>
<ul
class=
""
>
<ul
class=
""
>
{{ dep.data|unordered_list }}
{{ dep.data|unordered_list }}
</ul>
</ul>
...
@@ -24,20 +27,19 @@
...
@@ -24,20 +27,19 @@
</div>
</div>
{% else %}
{% else %}
<div
class=
"alert alert-success"
>
<div
class=
"alert alert-success"
>
No dependencies, safe to delete!
{% trans 'No dependencies, "safe" to delete!' %}
</div>
</div>
{% endif %}
{% endif %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
<form
action=
""
method=
"post"
>
{% csrf_token %}
<input
type=
"hidden"
value=
"{{ request.GET.from }}"
name=
"next"
/>
<input
type=
"hidden"
value=
"{{ request.GET.from }}"
name=
"next"
/>
{% if confirmation %}
{% if confirmation %}
<label><p>
<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 }}"
/>
<input
type=
"text"
name=
"confirm"
class=
"form-control"
placeholder=
"{{ object }}"
/>
</p></label>
</p></label>
{% else %}
{% else %}
{% endif %}
{% 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>
</form>
{% endblock %}
{% endblock %}
network/views.py
View file @
19f66acd
...
@@ -93,9 +93,9 @@ class BlacklistDelete(DeleteView):
...
@@ -93,9 +93,9 @@ class BlacklistDelete(DeleteView):
context
=
super
(
BlacklistDelete
,
self
)
.
get_context_data
(
**
kwargs
)
context
=
super
(
BlacklistDelete
,
self
)
.
get_context_data
(
**
kwargs
)
if
'pk'
in
self
.
kwargs
:
if
'pk'
in
self
.
kwargs
:
to_delete
=
Blacklist
.
objects
.
get
(
pk
=
self
.
kwargs
[
'pk'
])
to_delete
=
Blacklist
.
objects
.
get
(
pk
=
self
.
kwargs
[
'pk'
])
context
[
'
to_delete
'
]
=
"
%
s -
%
s -
%
s"
%
(
to_delete
.
ipv4
,
context
[
'
object
'
]
=
"
%
s -
%
s -
%
s"
%
(
to_delete
.
ipv4
,
to_delete
.
reason
,
to_delete
.
reason
,
to_delete
.
type
)
to_delete
.
type
)
return
context
return
context
def
get_success_url
(
self
):
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