Commit cdd266be authored by stef's avatar stef
Browse files

[enh] added status/editorial see also #25

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