Commit cdd266be authored by stef's avatar stef
Browse files

[enh] added status/editorial see also #25

parent 502a0a39
...@@ -50,6 +50,14 @@ MEDIA = ( ...@@ -50,6 +50,14 @@ MEDIA = (
('fixed', _('Fixed')), ('fixed', _('Fixed')),
('mobile', _('Mobile')), ('mobile', _('Mobile')),
) )
STATUS = (
('new', _('New')),
('duplicate', _('Duplicate')),
('closed', _('Closed')),
('confirmed', _('Confirmed')),
('moreinfo', _('Need more info')),
('ooscope', _('Out of scope')),
)
class Violation(models.Model): class Violation(models.Model):
country = models.CharField(max_length=2, choices=COUNTRIES) country = models.CharField(max_length=2, choices=COUNTRIES)
...@@ -64,6 +72,8 @@ class Violation(models.Model): ...@@ -64,6 +72,8 @@ class Violation(models.Model):
contract_excerpt = models.TextField(blank=True) contract_excerpt = models.TextField(blank=True)
loophole = models.BooleanField() loophole = models.BooleanField()
activationid= models.CharField(max_length=128, blank=True) activationid= models.CharField(max_length=128, blank=True)
state = models.CharField(max_length=20, choices=STATUS, default='new', blank=True)
editorial = models.TextField(blank=True)
def confirmations(self): def confirmations(self):
return self.confirmation_set.filter(key='').count() return self.confirmation_set.filter(key='').count()
......
...@@ -629,3 +629,12 @@ ul.messages { ...@@ -629,3 +629,12 @@ ul.messages {
#legend { text-align: center; margin-bottom: .5em; font-size: .7em; } #legend { text-align: center; margin-bottom: .5em; font-size: .7em; }
#legend li { padding: .1em; display: inline; } #legend li { padding: .1em; display: inline; }
#map { float: right; } #map { float: right; }
/*tr.new-status td { background: green !important; }
tr.duplicate-status td { background: #999 !important; }
tr.closed-status td { background: #888 !important; }
tr.confirmed-status td { background: #fff !important; }
tr.moreinfo-status td { background: yellow !important; }
tr.ooscope-status td { background: #aaa !important; }
*/
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
<a href="{%root_url%}/accounts/logout">{% trans "Logout" %}</a> <a href="{%root_url%}/accounts/logout">{% trans "Logout" %}</a>
<span>or</span> <span>or</span>
<a href="{%root_url%}/admin/">{% trans "Admin" %}</a> <a href="{%root_url%}/admin/">{% trans "Admin" %}</a>
{% block adminext %}
{% endblock %}
{% else %} {% else %}
<a href="{%root_url%}/admin/" id="login">{% trans "Login" %}</a> <a href="{%root_url%}/admin/" id="login">{% trans "Login" %}</a>
{% endif %} {% endif %}
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
$('#'+key+' path').css('fill', data[key]); $('#'+key+' path').css('fill', data[key]);
} }
$("#sortedlist").tablesorter({ $("#sortedlist").tablesorter({
headers: { 7: { sorter: false },}, headers: { 8: { sorter: false },},
sortList: [[0,0],[6,1]], sortList: [[1,0],[7,1]],
}); });
$('#sortedlist').tableFilter(); $('#sortedlist').tableFilter();
$('.confirm_form').submit(function() { $('.confirm_form').submit(function() {
...@@ -245,6 +245,7 @@ ...@@ -245,6 +245,7 @@
<table class="listing tablesorter zebra-striped" id='sortedlist'> <table class="listing tablesorter zebra-striped" id='sortedlist'>
<thead> <thead>
<tr> <tr>
<th filter-type='ddl'>{% trans "Status" %}</th>
<th filter-type='ddl'>{% trans "country" %}</th> <th filter-type='ddl'>{% trans "country" %}</th>
<th filter-type='ddl'>{% trans "operator" %}</th> <th filter-type='ddl'>{% trans "operator" %}</th>
<th filter-type='ddl'>{% trans "contract" %}</th> <th filter-type='ddl'>{% trans "contract" %}</th>
...@@ -257,7 +258,8 @@ ...@@ -257,7 +258,8 @@
</thead> </thead>
<tbody> <tbody>
{% for violation in violations %} {% for violation in violations %}
<tr> <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}}">{{ violation.country|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.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.contract }}</a></td>
......
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
{% load comments %} {% load comments %}
{% block styles %} {% block styles %}
{% endblock %} {% endblock %}
{% block adminext %}
, <a href="{%root_url%}/admin/bt/violation/{{v.id}}/ ">{% trans "Edit" %}</a>
{% endblock %}
{% block scripts %} {% block scripts %}
<script type="text/javascript" src="{%media_url%}/js/jquery.1.4.2.min.js"></script> <script type="text/javascript" src="{%media_url%}/js/jquery.1.4.2.min.js"></script>
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
...@@ -57,6 +60,7 @@ $(document).ready(function() { ...@@ -57,6 +60,7 @@ $(document).ready(function() {
<dl>{%if v.resource_name%}<dt>{% trans "Affected resource" %}</dt><dd>{{v.resource_name}}</dd>{%endif%} <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.type%}<dt>{% trans "Type" %}</dt><dd>{{v.type}}</dd>{%endif%}
{%if v.media%}<dt>{% trans "Media" %}</dt><dd>{{v.media}}</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.temporary%}<dt>{% trans "Temporary restriction" %}</dt><dd>{{v.temporary}}</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.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%} {%if v.contractual%}<dt>{% trans "Contractual restriction" %}</dt><dd>{% trans "yes" %}</dd>{%endif%}
...@@ -64,6 +68,12 @@ $(document).ready(function() { ...@@ -64,6 +68,12 @@ $(document).ready(function() {
{%if v.comment_set.all%}</dl> {%if v.comment_set.all%}</dl>
</div> </div>
{% if v.editorial %}
<div id="editorial" class='round-box'>
{{v.editorial}}
</div>
{% endif %}
<div id="description" class='round-box'> <div id="description" class='round-box'>
<h3>{%trans "Description" %}</h3> <h3>{%trans "Description" %}</h3>
{%for c in v.comment_set.all%} {%for c in v.comment_set.all%}
......
Supports Markdown
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