Commit 42d68009 authored by Baptiste Jonglez's avatar Baptiste Jonglez

[fix] i18n of 'media' and 'type' in list

parent 093b4229
......@@ -24,10 +24,10 @@ status_map=dict(STATUS)
def status(code):
return status_map[code]
types_map=dict(TYPES)
@register.filter(name='types')
def types(code):
return types_map[code]
type_map=dict(TYPES)
@register.filter(name='type')
def type(code):
return type_map[code]
media_map=dict(MEDIA)
@register.filter(name='media')
......
......@@ -257,8 +257,8 @@
<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_name }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.type }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.media }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.type|type }}</a></td>
<td><a class="cell-link" href="/view/{{violation.pk}}">{{ violation.media|media }}</a></td>
<td>{{ violation.confirmations }}</td>
<td>
<div class="confirm"><a class="button">{% trans "confirm" %}</a>
......
......@@ -66,7 +66,7 @@ $(document).ready(function() {
</div>
<dl>{%if v.resource_name%}<dt>{% trans "Affected resource" %}</dt><dd>{{v.resource_name}}</dd>{%endif%}
{%if v.type%}<dt>{% trans "Type" %}</dt><dd>{{v.type|types}}</dd>{%endif%}
{%if v.type%}<dt>{% trans "Type" %}</dt><dd>{{v.type|type}}</dd>{%endif%}
{%if v.media%}<dt>{% trans "Media" %}</dt><dd>{{v.media|media}}</dd>{%endif%}
{%if v.state%}<dt>{% trans "Status" %}</dt><dd>{{v.state|status}}</dd>{%endif%}
{%if v.temporary%}<dt>{% trans "Temporary restriction" %}</dt><dd>{{v.temporary}}</dd>{%endif%}
......
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