Commit 82dcb3dd authored by Baptiste Jonglez's avatar Baptiste Jonglez
parents 6f036f30 4d43e6b1
......@@ -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]
......@@ -154,6 +154,7 @@ $(document).ready(function(){
<tr>
<td colspan="3">
<div id="description" class='round-box'>
{% trans "Affected Resource" %}: {{violation.resource_name}}
{%for c in violation.comment_set.all%}
<div class="description">{{c.comment|safe}}</div>
<span class="submitter">{%if c.submitter_name%}{{c.submitter_name}}{%else%}{{c.submitter_email}}{%endif%}</span> - <span class="comment_date">{{c.timestamp|date:"SHORT_DATE_FORMAT" }}</span>
......
......@@ -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>
......
......@@ -68,7 +68,7 @@ $(document).ready(function() {
<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}}</dd>{%endif%}
{%if v.media%}<dt>{% trans "Media" %}</dt><dd>{{v.media}}</dd>{%endif%}
{%if v.state%}<dt>{% trans "Status" %}</dt><dd>{{v.state}}</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%}
{%if v.loophole%}<dt>{% trans "Another offer provided by the same operator removes this restriction" %}</dt><dd>{% trans "yes" %}</dd>{%endif%}
{%if v.contractual%}<dt>{% trans "Contractual restriction" %}</dt><dd>{% trans "yes" %}</dd>{%endif%}
......@@ -78,7 +78,8 @@ $(document).ready(function() {
{% if v.editorial %}
<div id="editorial" class='round-box'>
{{v.editorial}}
<h3>{% trans "RespectMyNet note" %}</h3>
{{v.editorial|striptags|urlize|linebreaks}}
</div>
{% 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