Commit c59a4ab6 authored by stef's avatar stef
Browse files

[enh] #37 - needs some styling

parent 04853590
......@@ -193,10 +193,28 @@ def ajax(request, country=None, operator=None):
def index(request):
v_list = Violation.objects.filter(activationid='',featuredcase__isnull=False).order_by('id').reverse()[:3]
form = AddViolation()
for i in Violation.objects.values('id').filter(activationid='').annotate(total=Count('confirmation'))],
for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('country'))],
for i in Violation.objects.values('country').filter(activationid='').annotate(total=Count('confirmation'))],
for i in Violation.objects.values('operator').filter(activationid='').annotate(total=Count('confirmation'))],
return render_to_response(
{ 'form': form,
'stats': [ ('Countries with reports(confirmed)', len(countries), len([i for i,_ in confirms if i>1])),
('Total reports (confirmed)', sum([i for i,_ in countries]),len([i for i,_ in reports if i>1])),
('Total Operators with reports(confirmed)', len(operators), len([x for x in operators if x[0]>1])),
('Total confirmations(most)', sum([i for i, _ in confirms]), reports[0][0]),
'violations': v_list },
......@@ -694,3 +694,7 @@ tr.ooscope-status td { background: #aaa !important; }
.legendclass2 { background: rgba(255, 138, 00, 0.4);}
.legendclass1 { background: rgba(255, 204, 00, 0.4);}
.legendclass0 { background: rgba(255, 255, 00, 0.4);}
.inline { display: inline; }
.stat dt { width: 20em; display: inline-block; }
......@@ -12,6 +12,7 @@
<script type="text/javascript" src="{%media_url%}/js/jquery.tablesorter.min.js"> </script>
<script type="text/javascript" src="{%media_url%}/js/form.js"></script>
<script type="text/javascript">
var json = {{stats_graph|safe}};
function focushandlers(ed) {
var s = ed.settings;
var realID = $('#''_tbl');
......@@ -124,6 +125,13 @@ $(document).ready(function(){
<p>{% trans "Help us chart all the ways that internet providers are violating our online freedom. Tell us about how your landline or mobile operator Internet provider restricts your connection. You can do so in less than two minutes!" %}
<p>{% trans "We will report these violations to the European Commission and national authorities and demand action to address them." %}</p>
<p>{% trans "Don't hesitate to give us feedback on this application by reporting any idea or issue with here : <a href=''>Feedback pad page</a>" %}</p>
<h2>{% trans "Statistics" %}</h2>
<div id="stats_graph" ></div>
<ul id="stats">
{% for t, n, n1 in stats %}
<li class="stat"><dl><dt class="inline">{{t}}</dt><dd class="inline">{{n}}({{n1}})</dd></dl></li>
{% endfor %}
<h2>{% trans "Featured Cases" %}</h2>
<table id="featured_cases">
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