Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
Respect My Net
Commits
6ec7b34d
Commit
6ec7b34d
authored
Jun 13, 2011
by
stef
Browse files
[enh] updated i18n markup of strings
parent
43c5d846
Changes
4
Hide whitespace changes
Inline
Side-by-side
bt/views.py
View file @
6ec7b34d
...
...
@@ -45,7 +45,7 @@ def activate(request):
v
=
Violation
.
objects
.
get
(
activationid
=
request
.
GET
.
get
(
'key'
,
'asdf'
))
v
.
activationid
=
''
v
.
save
()
messages
.
add_message
(
request
,
messages
.
INFO
,
'Thank you for verifying your submission.'
)
messages
.
add_message
(
request
,
messages
.
INFO
,
_
(
'Thank you for verifying your submission.'
)
)
return
HttpResponseRedirect
(
'/'
)
# Redirect after POST
def
add
(
request
):
...
...
@@ -53,8 +53,8 @@ def add(request):
form
=
AddViolation
(
request
.
POST
)
if
form
.
is_valid
():
actid
=
hashlib
.
sha1
(
''
.
join
([
chr
(
randint
(
32
,
122
))
for
x
in
range
(
12
)])).
hexdigest
()
msg
=
MIMEText
(
"Your verification key is %s/activate?key=%s
\n
"
%
(
settings
.
ROOT_URL
or
'http://localhost:8001/'
,
actid
))
msg
[
'Subject'
]
=
'NNMon submission verification'
msg
=
MIMEText
(
_
(
"Your verification key is %s/activate?key=%s
\n
"
)
%
(
settings
.
ROOT_URL
or
'http://localhost:8001/'
,
actid
))
msg
[
'Subject'
]
=
_
(
'NNMon submission verification'
)
msg
[
'From'
]
=
'nnmon@nnmon.lqdn.fr'
msg
[
'To'
]
=
form
.
cleaned_data
[
'email'
]
s
=
smtplib
.
SMTP
(
'localhost'
)
...
...
@@ -92,7 +92,7 @@ def add(request):
a
.
storage
.
save
(
sname
,
f
)
a
.
save
()
messages
.
add_message
(
request
,
messages
.
INFO
,
'Thank you for submitting this report, you will receive a verification email shortly.'
)
messages
.
add_message
(
request
,
messages
.
INFO
,
_
(
'Thank you for submitting this report, you will receive a verification email shortly.'
)
)
return
HttpResponseRedirect
(
'/'
)
# Redirect after POST
else
:
form
=
AddViolation
()
...
...
templates/base.html
View file @
6ec7b34d
{% load bt %}
<?xml version="1.0" encoding="utf-8"?>
{% load i18n %}
{% load bt %}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"hu"
xml:lang=
"hu"
>
<head>
...
...
@@ -20,17 +20,17 @@
<div
id=
"auth"
class=
"menu"
>
{% if user.is_authenticated %}
<a
href=
"{%root_url%}/accounts/settings"
>
{{ user.username }}
</a>
<a
href=
"{%root_url%}/accounts/logout"
>
Logout
</a>
<a
href=
"{%root_url%}/admin/"
>
Admin
</a>
<a
href=
"{%root_url%}/accounts/logout"
>
{% trans "
Logout
" %}
</a>
<a
href=
"{%root_url%}/admin/"
>
{% trans "
Admin
" %}
</a>
{% else %}
<a
href=
"{%root_url%}/accounts/login"
>
Login
</a>
<a
href=
"{%root_url%}/accounts/register"
>
Register
</a>
<a
href=
"{%root_url%}/accounts/login"
>
{% trans "
Login
" %}
</a>
<a
href=
"{%root_url%}/accounts/register"
>
{% trans "
Register
" %}
</a>
{% endif %}
</div>
<div
id=
"menu"
class=
"menu"
>
<a
href=
"{%root_url%}/add/"
>
Report restriction
</a>
<a
href=
"{%root_url%}/"
>
List reports
</a>
<a
href=
"{%root_url%}/add/"
>
{% trans "
Report restriction
" %}
</a>
<a
href=
"{%root_url%}/"
>
{% trans "
List reports
" %}
</a>
</div>
{% block content %}
...
...
templates/list.html
View file @
6ec7b34d
...
...
@@ -24,17 +24,17 @@
<table
class=
"listing tablesorter"
id=
'sortedlist'
>
<thead>
<tr>
<th>
id
</th>
<th>
country
</th>
<th>
operator
</th>
<th>
contract
</th>
<th>
resource
</th>
<th>
type
</th>
<th>
media
</th>
<th>
temporary
</th>
<th>
contractual
</th>
<th>
contractual_excerpt
</th>
<th>
loophole
</th>
<th>
{% trans "id" %}
</th>
<th>
{% trans "
country
" %}
</th>
<th>
{% trans "
operator
" %}
</th>
<th>
{% trans "
contract
" %}
</th>
<th>
{% trans "
resource
" %}
</th>
<th>
{% trans "type" %}
</th>
<th>
{% trans "
media
" %}
</th>
<th>
{% trans "
temporary
" %}
</th>
<th>
{% trans "
contractual
" %}
</th>
<th>
{% trans "
contractual_excerpt
" %}
</th>
<th>
{% trans "
loophole
" %}
</th>
</tr>
</thead>
<tbody>
...
...
@@ -63,11 +63,11 @@
{% endif %}
<span
class=
"current"
>
Page
{{ violations.number }}
of
{{ violations.paginator.num_pages }}.
{% trans "Page" %}
{{ violations.number }}
{% trans "of" %}
{{ violations.paginator.num_pages }}.
</span>
{% if violations.has_next %}
<a
href=
"?page={{ violations.next_page_number }}"
>
next
</a>
<a
href=
"?page={{ violations.next_page_number }}"
>
{% trans "next" %}
</a>
{% endif %}
</span>
</div>
...
...
templates/view.html
View file @
6ec7b34d
...
...
@@ -38,16 +38,16 @@ $(document).ready(function() {
{%block content%}
<ul
id=
"report"
>
<li><dl><dt>
Operator
</dt><dd>
{{v.operator}} ({{v.country}})
</dd></dl></li>
<li><dl><dt>
Contract
</dt><dd>
{{v.contract}}
</dd></dl></li>
{%if v.resource%}
<li><dl><dt>
Resource
</dt><dd>
{{v.resource}}
</dd></dl></li>
{%endif%}
{%if v.resource_name%}
<li><dl><dt>
Resource name
</dt><dd>
{{v.resource_name}}
</dd></dl></li>
{%endif%}
{%if v.type%}
<li><dl><dt>
Type
</dt><dd>
{{v.type}}
</dd></dl></li>
{%endif%}
{%if v.media%}
<li><dl><dt>
Media
</dt><dd>
{{v.media}}
</dd></dl></li>
{%endif%}
{%if v.temporary%}
<li><dl><dt>
Temporary restriction
</dt><dd>
{{v.temporary}}
</dd></dl></li>
{%endif%}
{%if v.loophole%}
<li><dl><dt>
Loophole offering
</dt><dd>
{{v.loophole}}
</dd></dl></li>
{%endif%}
{%if v.contractual%}
<li><dl><dt>
Contractual restriction
</dt><dd>
{{v.Contractual}}
</dd></dl></li>
{%endif%}
{%if v.contract_excerpt%}
<li><dl><dt>
Contract excerpt
</dt><dd>
{{v.contract_excerpt|safe}}
</dd></dl></li>
{%endif%}
<li><dl><dt>
{% trans "
Operator
" %}
</dt><dd>
{{v.operator}} ({{v.country}})
</dd></dl></li>
<li><dl><dt>
{% trans "
Contract
" %}
</dt><dd>
{{v.contract}}
</dd></dl></li>
{%if v.resource%}
<li><dl><dt>
{% trans "
Resource
" %}
</dt><dd>
{{v.resource}}
</dd></dl></li>
{%endif%}
{%if v.resource_name%}
<li><dl><dt>
{% trans "
Resource name
" %}
</dt><dd>
{{v.resource_name}}
</dd></dl></li>
{%endif%}
{%if v.type%}
<li><dl><dt>
{% trans "Type" %}
</dt><dd>
{{v.type}}
</dd></dl></li>
{%endif%}
{%if v.media%}
<li><dl><dt>
{% trans "
Media
" %}
</dt><dd>
{{v.media}}
</dd></dl></li>
{%endif%}
{%if v.temporary%}
<li><dl><dt>
{% trans "
Temporary restriction
" %}r
</dt><dd>
{{v.temporary}}
</dd></dl></li>
{%endif%}
{%if v.loophole%}
<li><dl><dt>
{% trans "
Loophole offering
" %}
</dt><dd>
{{v.loophole}}
</dd></dl></li>
{%endif%}
{%if v.contractual%}
<li><dl><dt>
{% trans "
Contractual restriction
" %}
</dt><dd>
{{v.Contractual}}
</dd></dl></li>
{%endif%}
{%if v.contract_excerpt%}
<li><dl><dt>
{% trans "
Contract excerpt
" %}
</dt><dd>
{{v.contract_excerpt|safe}}
</dd></dl></li>
{%endif%}
{%if v.comment_set.all%}
<li
id=
"description"
>
<h3>
{%trans "Description" %}
</h3>
...
...
@@ -57,7 +57,7 @@ $(document).ready(function() {
<div
class=
"description"
>
{{c.comment|safe}}
</div>
{%if c.attachment_set.all%}
<div
class=
"attachs"
>
Attachments
{% trans "
Attachments
" %}
<ul>
{%for a in c.attachment_set.all%}
<li><a
href=
"{{a.storage.url}}"
>
{{a.storage.name}}
</a></li>
...
...
@@ -70,9 +70,9 @@ $(document).ready(function() {
</li>
</ul>
{%endif%}
<h3>
Comments
</h3>
<h3>
{% trans "
Comments
" %}
</h3>
{% render_comment_list for v %}
<h3>
Comment
</h3>
<h3>
{% trans "
Comment
" %}
</h3>
{% get_comment_form for v as form %}
<div
id=
"comment_form"
>
{% render_comment_form for v %}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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