fedora_elections/elections.py | 8 ++++----
fedora_elections/models.py | 2 +-
fedora_elections/templates/results.html | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit 67b67a893bba1f3b18d620907aa909fc9c6d6293
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Dec 2 15:25:35 2014 +0100
Rename stats['dates'] to stats['vote_timestamps'] as per @ralphbean 's advice
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 369edda..b04ee69 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -372,7 +372,7 @@ def election_results(election_alias):
election.start_date + timedelta(days=delta)
).strftime('%d-%m-%Y')
evolution_label.append([cnt, day])
- evolution_data.append([cnt, stats['dates'].count(day)])
+ evolution_data.append([cnt, stats['vote_timestamps'].count(day)])
cnt += 1
return flask.render_template(
diff --git a/fedora_elections/models.py b/fedora_elections/models.py
index e6cddc0..8f80914 100644
--- a/fedora_elections/models.py
+++ b/fedora_elections/models.py
@@ -432,7 +432,7 @@ class Vote(BASE):
Vote.timestamp
).all()
- stats['dates'] = [
+ stats['vote_timestamps'] = [
date[0].strftime('%d-%m-%Y')
for date in dates
]
commit f9f227f4042e7fba7872ee20545f64c55869f34b
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Dec 2 15:24:28 2014 +0100
Adjust label in the graph as per @ralphbean 's suggestion
diff --git a/fedora_elections/templates/results.html b/fedora_elections/templates/results.html
index 6965fb5..1388ebd 100644
--- a/fedora_elections/templates/results.html
+++ b/fedora_elections/templates/results.html
@@ -119,7 +119,7 @@
var data = [{'color': '#1F77B4',
'data': {{ evolution_data }},
'bars': {'order': 1, 'barWidth': 0.8, 'show': 1},
- 'label': 'Evolution of the voters during the election',
+ 'label': 'Voters over time',
'ticks': {{ evolution_label }},
}];
{% endautoescape %}
commit a6494661069d1721476d0a0279b6301b9a08241f
Author: Pierre-Yves Chibon <pingou(a)pingoured.fr>
Date: Tue Dec 2 15:23:23 2014 +0100
Rename evolution_lbl to evolution_label as per @ralphbean 's advice
diff --git a/fedora_elections/elections.py b/fedora_elections/elections.py
index 6f76f9d..369edda 100644
--- a/fedora_elections/elections.py
+++ b/fedora_elections/elections.py
@@ -365,13 +365,13 @@ def election_results(election_alias):
stats = models.Vote.get_election_stats(SESSION, election.id)
cnt = 1
- evolution_lbl = []
+ evolution_label = []
evolution_data = []
for delta in range((election.end_date - election.start_date).days + 1):
day = (
election.start_date + timedelta(days=delta)
).strftime('%d-%m-%Y')
- evolution_lbl.append([cnt, day])
+ evolution_label.append([cnt, day])
evolution_data.append([cnt, stats['dates'].count(day)])
cnt += 1
@@ -380,7 +380,7 @@ def election_results(election_alias):
election=election,
usernamemap=usernamemap,
stats=stats,
- evolution_lbl=evolution_lbl,
+ evolution_label=evolution_label,
evolution_data=evolution_data,
)
diff --git a/fedora_elections/templates/results.html b/fedora_elections/templates/results.html
index 7f57b08..6965fb5 100644
--- a/fedora_elections/templates/results.html
+++ b/fedora_elections/templates/results.html
@@ -120,7 +120,7 @@
'data': {{ evolution_data }},
'bars': {'order': 1, 'barWidth': 0.8, 'show': 1},
'label': 'Evolution of the voters during the election',
- 'ticks': {{ evolution_lbl }},
+ 'ticks': {{ evolution_label }},
}];
{% endautoescape %}