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
piks3l
Respect My Net
Commits
208359de
Commit
208359de
authored
Sep 22, 2011
by
stef
Browse files
[enh] full country names displayed
parent
00bdde24
Changes
4
Hide whitespace changes
Inline
Side-by-side
bt/templatetags/bt.py
View file @
208359de
...
...
@@ -2,6 +2,7 @@ from django.template import Library, Variable
from
django.conf
import
settings
from
django
import
template
import
random
from
nnmon.bt.models
import
COUNTRIES
register
=
Library
()
...
...
@@ -13,3 +14,7 @@ def root_url():
def
media_url
():
return
settings
.
MEDIA_URL
country_map
=
dict
(
COUNTRIES
)
@
register
.
filter
(
name
=
'country'
)
def
country
(
code
):
return
country_map
[
code
]
bt/views.py
View file @
208359de
...
...
@@ -9,7 +9,7 @@ from django.core.exceptions import ObjectDoesNotExist
from
django.contrib
import
messages
from
django.contrib.auth.models
import
User
from
django.utils.translation
import
ugettext_lazy
as
_
from
models
import
Violation
,
Attachment
,
Comment
,
Confirmation
,
COUNTRIES
from
models
import
Violation
,
Attachment
,
Comment
,
Confirmation
from
tempfile
import
mkstemp
from
datetime
import
datetime
import
hashlib
,
os
,
re
,
json
,
smtplib
...
...
templates/index.html
View file @
208359de
...
...
@@ -131,7 +131,7 @@ $(document).ready(function(){
<tbody>
{% for violation in violations %}
<tr>
<td><a
href=
"/view/{{violation.pk}}"
>
{{ violation.operator }} ({{ violation.country }}) {{ violation.contract }}
</a>
<td><a
href=
"/view/{{violation.pk}}"
>
{{ violation.operator }} ({{ violation.country
|country
}}) {{ violation.contract }}
</a>
<div
class=
"info-validate"
>
<form
method=
"get"
id=
"{{ violation.pk }}"
class=
"confirm_form"
>
<label>
{% trans "In order to
<strong>
validate your action
</strong>
, please enter your email address" %}
</label>
...
...
templates/list.html
View file @
208359de
...
...
@@ -52,7 +52,7 @@
<tbody>
{% for violation in violations %}
<tr>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.country }}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.country
|country
}}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.operator }}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.contract }}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{{ violation.resource }}
</a></td>
...
...
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