aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2013-05-17 23:07:43 +0000
committerNicolas Vigier <boklm@mageia.org>2013-05-17 23:07:43 +0000
commit4a959e9f97dc67c4d4a78ee6516c564e5d952181 (patch)
tree6b04c140b62d62521d86cf4b836c39e688b3d04b /tmpl
parent80e1b696eb2b1bb15822bccd5baa0181bc406792 (diff)
downloadmgatres-4a959e9f97dc67c4d4a78ee6516c564e5d952181.tar
mgatres-4a959e9f97dc67c4d4a78ee6516c564e5d952181.tar.gz
mgatres-4a959e9f97dc67c4d4a78ee6516c564e5d952181.tar.bz2
mgatres-4a959e9f97dc67c4d4a78ee6516c564e5d952181.tar.xz
mgatres-4a959e9f97dc67c4d4a78ee6516c564e5d952181.zip
Add accounts history graphs
git-svn-id: svn+ssh://svn.mageia.org/svn/soft/mga-treasurer/trunk@8324 5b7c3c08-40e5-403b-9995-ace06908e4af
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/index.html37
-rw-r--r--tmpl/transactions_by_year.html35
2 files changed, 71 insertions, 1 deletions
diff --git a/tmpl/index.html b/tmpl/index.html
index a6e4b1b..8d209bd 100644
--- a/tmpl/index.html
+++ b/tmpl/index.html
@@ -3,6 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[% config.sitename %] treasurer infos</title>
+ [% INCLUDE head_chart.html %]
</head>
<body>
<h1>treasurer.mageia.og</h1>
@@ -45,9 +46,43 @@
<h3>Accounts history</h3>
+ <canvas id="accounts_history_bar_chart" height="250" width="[% 80 + transactions.by_year.keys.size * 100 %]"></canvas>
+
+ <script>
+
+ var barChartData = {
+ labels : ["[% transactions.by_year.keys.sort.reverse.join('","') %]"],
+ datasets : [
+ {
+ fillColor : "#151f79",
+ strokeColor : "#101333",
+ data : [
+ [%- FOR year IN transactions.by_year.keys.sort.reverse -%]
+ [%- transactions.by_year.$year.revenues -%]
+ [%- IF ! loop.last() -%],[%- END -%]
+ [%- END %]]
+ },
+ {
+ fillColor : "#e51b1b",
+ strokeColor : "#f11111",
+ data: [
+ [%- FOR year IN transactions.by_year.keys.sort.reverse -%]
+ [%- transactions.by_year.$year.expenses -%]
+ [%- IF ! loop.last() -%],[%- END -%]
+ [%- END %]]
+ }
+ ]
+
+ }
+
+ var myLine = new Chart(document.getElementById("accounts_history_bar_chart").getContext("2d")).Bar(barChartData);
+
+ </script>
+
+
<ul>
[%- FOR year IN transactions.by_year.keys.sort.reverse -%]
- <li><a href="y_[% year %].html">[%- year -%]</a></li>
+ <li><a href="y_[% year %].html">[%- year -%]</a> - Expenses: [% transactions.by_year.$year.expenses %] Revenues: [% transactions.by_year.$year.revenues %]</li>
[%- END -%]
</ul>
diff --git a/tmpl/transactions_by_year.html b/tmpl/transactions_by_year.html
index 2397d1d..d4e7550 100644
--- a/tmpl/transactions_by_year.html
+++ b/tmpl/transactions_by_year.html
@@ -2,6 +2,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>[% config.sitename %]: Transactions for [% year %]</title>
+ [% INCLUDE head_chart.html %]
</head>
<body>
<h1>Mageia.Org accounts transactions for year [% year %]</h1>
@@ -27,6 +28,40 @@
[%- END -%]
</ul>
<h3>Monthly reports</h3>
+
+ <canvas id="accounts_history_bar_chart" height="250" width="[% 80 + transactions.by_year.$year.months.size * 65 %]"></canvas>
+
+ <script>
+
+ var barChartData = {
+ labels : ["[% transactions.by_year.$year.months.sort.join('","') %]"],
+ datasets : [
+ {
+ fillColor : "#151f79",
+ strokeColor : "#101333",
+ data : [
+ [%- FOR month IN transactions.by_year.$year.months.sort -%]
+ [%- transactions.by_month.$month.revenues -%]
+ [%- IF ! loop.last() -%],[%- END -%]
+ [%- END %]]
+ },
+ {
+ fillColor : "#e51b1b",
+ strokeColor : "#f11111",
+ data: [
+ [%- FOR month IN transactions.by_year.$year.months.sort -%]
+ [%- transactions.by_month.$month.expenses -%]
+ [%- IF ! loop.last() -%],[%- END -%]
+ [%- END %]]
+ }
+ ]
+
+ }
+
+ var myLine = new Chart(document.getElementById("accounts_history_bar_chart").getContext("2d")).Bar(barChartData);
+
+ </script>
+
<ul>
[%- FOR month IN transactions.by_month.keys.sort -%]
[%- IF transactions.by_month.$month.year == year -%]