Commit 6d5958a6 authored by stef's avatar stef

[enh] added legend to map on view

parent af1e9241
......@@ -214,13 +214,16 @@ def list_violations(request):
for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('country'))],
countries=json.dumps(dict([(c.lower(),"#ff%x00" % (3*int(64*(float(w)/countries[0][0]))+63)) for w,c in countries]))
legend=sorted(set([(w, "rgba(255,%d, 00, 0.4)" % (w*768/(countries[0][0]+1)%256)) for w,c in countries]),reverse=True)
countrycolors=json.dumps(dict([(c.lower(),"#ff%02x00" % (w*768/(countries[0][0]+1)%256)) for w,c in countries]))
# for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('confirmation'))],
# reverse=True)
return render_to_response('list.html',
{"violations": violations,
"countries": countries,},
"countries": dict([(y,x) for x,y in countries]),
"countrycolors": countrycolors,
"legend": legend,},
#"confirms": confirms,},
......@@ -625,4 +625,7 @@ ul.messages {
#similar_cases li { list-style: disc inside; margin-left: 0.3em; color: black; }
.mceToolbar { display:none; }
\ No newline at end of file
.mceToolbar { display:none; }
#legend { text-align: center; margin-bottom: .5em; font-size: .7em; }
#legend li { padding: .1em; display: inline; }
#map { float: right; }
This diff is collapsed.
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