Commit 9e6b9cf1 authored by stef's avatar stef

[fix] status in lists

parent 7ee269a0
......@@ -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]
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment