aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl/donations_by_year.html
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-17 23:07:35 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-17 23:07:35 +0000
commit80e1b696eb2b1bb15822bccd5baa0181bc406792 (patch)
tree17cf76937ac25cf35f6c8ebb0c8118b488ae66de /tmpl/donations_by_year.html
parent5d9ad62cb3940986954c4ba48645fc1506f0ea82 (diff)
downloadmgatres-80e1b696eb2b1bb15822bccd5baa0181bc406792.tar
mgatres-80e1b696eb2b1bb15822bccd5baa0181bc406792.tar.gz
mgatres-80e1b696eb2b1bb15822bccd5baa0181bc406792.tar.bz2
mgatres-80e1b696eb2b1bb15822bccd5baa0181bc406792.tar.xz
mgatres-80e1b696eb2b1bb15822bccd5baa0181bc406792.zip
Add donations graphs
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8323 5b7c3c08-40e5-403b-9995-ace06908e4af
Diffstat (limited to 'tmpl/donations_by_year.html')
-rw-r--r--tmpl/donations_by_year.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/tmpl/donations_by_year.html b/tmpl/donations_by_year.html
index f81325c..c9a963f 100644
--- a/tmpl/donations_by_year.html
+++ b/tmpl/donations_by_year.html
@@ -2,6 +2,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[% config.sitename %]: Donations for [% year %]</title>
+ [% INCLUDE head_chart.html %]
</head>
<body>
<h1>Mageia.Org donations for year [% year %]</h1>
@@ -17,6 +18,33 @@
[%- END -%]
</ul>
<h3>Donations for each month</h3>
+
+ [% IF donations.by_year.$year.months.size > 1 %]
+ <canvas id="donations_history_bar_chart" height="250" width="[% 80 + donations.by_year.$year.months.size * 65 %]"></canvas>
+
+ <script>
+
+ var barChartData = {
+ labels : ["[% donations.by_year.$year.months.sort.join('","') %]"],
+ datasets : [
+ {
+ fillColor : "#151f79",
+ strokeColor : "#101333",
+ data : [
+ [%- FOR month IN donations.by_year.$year.months.sort -%]
+ [%- donations.by_month.$month.total -%]
+ [%- IF ! loop.last() -%],[%- END -%]
+ [%- END %]]
+ }
+ ]
+
+ }
+
+ var myLine = new Chart(document.getElementById("donations_history_bar_chart").getContext("2d")).Bar(barChartData);
+
+ </script>
+ [% END %]
+
<ul>
[%- FOR month IN donations.by_month.keys.sort -%]
[%- IF donations.by_month.$month.year == year -%]