Skip to content
GitLab
Menu
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
9e6b9cf1
Commit
9e6b9cf1
authored
Nov 16, 2011
by
stef
Browse files
[fix] status in lists
parent
7ee269a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
bt/templatetags/bt.py
View file @
9e6b9cf1
...
...
@@ -2,7 +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
from
nnmon.bt.models
import
COUNTRIES
,
STATUS
register
=
Library
()
...
...
@@ -18,3 +18,8 @@ country_map=dict(COUNTRIES)
@
register
.
filter
(
name
=
'country'
)
def
country
(
code
):
return
country_map
[
code
]
status_map
=
dict
(
STATUS
)
@
register
.
filter
(
name
=
'status'
)
def
status
(
code
):
return
status_map
[
code
]
templates/list.html
View file @
9e6b9cf1
...
...
@@ -249,7 +249,7 @@
<tbody>
{% for violation in violations %}
<tr
class=
"{%if violation.state%}{{violation.state}}{%else%}new{%endif%}-status"
>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{%if violation.state%}{{violation.state}}{%else%}
new
{%endif%}
</a></td>
<td><a
class=
"cell-link"
href=
"/view/{{violation.pk}}"
>
{%if violation.state%}{{violation.state
|status
}}{%else%}
{% trans "New" %}
{%endif%}
</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>
...
...
Write
Preview
Supports
Markdown
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