diff --git a/bt/views.py b/bt/views.py index 8c544f46c2dbdca85da307d684ac91e9c0a987b7..95039209620860a0a48d6164048c633029b369bf 100644 --- a/bt/views.py +++ b/bt/views.py @@ -234,13 +234,9 @@ def filter_violations(request, country, operator=None): violations = Violation.objects.filter(activationid='', country=country, operator_ref__name=operator) if not request.GET.get('all'): violations = violations.exclude(state__in=['duplicate', 'closed']) - countries=sorted([(i['total'],i['country']) - for i in Violation.objects.values('country').filter(activationid='',country=country).exclude(state__in=['duplicate', 'closed']).annotate(total=Count('country'))], - reverse=True) - countryweights=json.dumps([{'iso2': y, 'w': x} for x, y in countries]) return render_to_response('list.html', { "violations": violations, - "country": country, + "country": country, "status": STATUS }, context_instance=RequestContext(request)) @@ -252,11 +248,6 @@ def list_violations(request): for i in Violation.objects.values('country').filter(activationid='').exclude(state__in=['duplicate', 'closed']).annotate(total=Count('country'))], reverse=True) countryweights=json.dumps([{'iso2': y, 'w': x} for x, y in countries]) - #countrycolors=json.dumps(dict([(c.lower(),"#ff%02x00" % (w*768/(countries[0][0]+1)%256)) for w,c in countries])) - #confirms=sorted([(i['total'],i['country']) - # for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('confirmation')) - # if i['total']>1], - # reverse=True) return render_to_response('list.html', {"violations": violations, "countries": dict([(y,x) for x,y in countries]), diff --git a/nnmon/media/js/map.js b/nnmon/media/js/map.js index aebab1500eda69dc704818ec32933b5899d7b115..96f8941e42b52b18202918e3cf6f747a5f68278c 100644 --- a/nnmon/media/js/map.js +++ b/nnmon/media/js/map.js @@ -17,13 +17,7 @@ $(document).ready(function() { dataset[iso] = { numberOfCases: value, fillColor: paletteScale(value)}; }); - /* We want to highlight a country if we've selected one */ - var url_segments = window.location.pathname.split('/'); - url_segments.pop(); //This one is empty - var country = url_segments.pop(), - page = url_segments.pop(); - - if (page === 'list') { + if (country) { dataset[country] = {fillColor: '#02386F'}; }