Commit 6d04a6bd authored by stef's avatar stef

Merge branch 'master' of github.com:stef/nnmon

Conflicts:
	bt/views.py
parents 7dc4e3da 5e7363cf
......@@ -51,10 +51,10 @@ MEDIA = (
('mobile', _('Mobile')),
)
STATUS = (
('moreinfo', _('Need more info')),
('new', _('New')),
('duplicate', _('Duplicate')),
('verified', _('Verified')),
('moreinfo', _('Need more info')),
('duplicate', _('Duplicate')),
('ooscope', _('Out of scope')),
('closed', _('Closed')),
)
......
......@@ -11,7 +11,7 @@ from django.contrib import messages
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.db.models import Count
from models import Violation, Attachment, Comment, Confirmation, COUNTRIES
from models import Violation, Attachment, Comment, Confirmation, COUNTRIES, STATUS
from tempfile import mkstemp
from datetime import datetime
import hashlib, os, re, json, smtplib
......@@ -225,7 +225,10 @@ def filter_violations(request, country, operator=None):
violations = Violation.objects.filter(activationid='', country=country, operator=operator)
if not request.GET.get('all'):
violations = violations.exclude(state__in=['duplicate', 'closed'])
return render_to_response('list.html', {"violations": violations},context_instance=RequestContext(request))
return render_to_response('list.html',
{ "violations": violations,
"status": STATUS },
context_instance=RequestContext(request))
def list_violations(request):
violations = Violation.objects.filter(activationid='')
......@@ -265,7 +268,8 @@ def list_violations(request):
{"violations": violations,
"countries": dict([(y,x) for x,y in countries]),
"countrycolors": countrycolors,
"legend": legend,},
"legend": legend,
"status": STATUS,},
#"confirms": confirms,},
context_instance=RequestContext(request))
......
......@@ -629,7 +629,7 @@ input[type=submit]:hover, input[type=button]:hover, .button:hover {
}
#content .zebra-striped tbody tr:hover td,
.zebra-striped tbody tr:hover td {
background-color: rgba(255, 240, 0, 0.4);;
background-color: rgba(255, 240, 0, 0.3);;
}
#content .zebra-striped .header {
cursor: pointer;
......@@ -686,13 +686,12 @@ ul.messages {
.logo-org { display: inline-block; width: 114px; text-align: center; vertical-align: top; }
/*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; }
*/
/*tr.new-status td { background: green !important; }*/
tr.duplicate-status td { background: #aaa !important; }
tr.closed-status td { background: #999 !important; }
tr.ooscope-status td { background: #bbb !important; }
/*tr.verified-status td { background: #fff !important; }*/
tr.moreinfo-status td { background: #ff6 !important; }
.legendclass4 { background: rgba(255, 00, 00, 0.4); }
.legendclass3 { background: rgba(255, 68, 00, 0.4); }
......
......@@ -27,9 +27,24 @@
$('#'+key+' path').css('fill', data[key]);
}
{% endif %}
$.tablesorter.addParser({
// set a unique id
id: 'stateparser',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format your data for normalization
return s{% for s, translation in status %}.replace(/{{translation}}/,{{forloop.counter}}){% endfor %};
},
// set type, either numeric or text
type: 'numeric'
});
$("#sortedlist").tablesorter({
headers: { 8: { sorter: false },},
sortList: [[1,0],[7,1]],
headers: { 8: { sorter: false },
0: { sorter: 'stateparser' }},
sortList: [[1,0],[0,0],[7,1]],
});
var options = { enableCookies: false };
$('#sortedlist').tableFilter(options);
......
......@@ -60,7 +60,7 @@ $(document).ready(function() {
<div id="report">
<div id="icons">
<span id="verified_tooltip" class="tooltip">{% trans "This case was verified by the management team" %}</span>
<span id="confirmations_tooltip" class="tooltip">{%if v.confirmations == 0 %} {% trans "Nobody has yet confirmed the case. Feel free to do it" %} {%else%} {{v.confirmations}} {%if v.confirmations == 1 %} {% trans "person has confirmed this case" %} {%else%} {% trans "persons have confirmed this case" %} {%endif%} {%endif%}</span>
<span class="tooltip_on">{%if v.confirmations == 0 %} {% trans "Nobody has yet confirmed the case. Feel free to do it" %} {%else%} {{v.confirmations}} {%if v.confirmations == 1 %} {% trans "person has confirmed this case" %} {%else%} {% trans "persons have confirmed this case" %} {%endif%} {%endif%}</span>
{% if v.state == 'verified' %}<span id="verified"></span> |{% endif %}
<span id="confirmations">{{v.confirmations}}</span> |
</div>
......
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