aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl/donations_by_year.html
blob: ffbcdaf86c6be9b3b151d9655d3befbab968c2e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>[% config.sitename %]: Donations for [% year %]</title>
        [%- INCLUDE head.html -%]
        [% INCLUDE head_chart.html %]
    </head>
    <body>
        [%- INCLUDE body_top.html -%]
        <h1 id='mgnavt'><a href="index.html">treasurer</a> » <a href="donations.html">donations</a> » year [% year %]</h1>

        <div class="content">
            <h1>Mageia.Org donations for year [% year %]</h1>
            <h2>Summary</h2>
            <ul>
                <li>
                <b>Total</b>: [% donations.by_year.$year.total %] Euros
                </li>
                [%- FOR type IN donations.by_year.$year.type.keys -%]
                <li>
                <b>[% type %]</b>: [% donations.by_year.$year.type.$type %] Euros
                </li>
                [%- END -%]
            </ul>
            <h2>Donations for each month</h2>

            [% 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 -%]
                <li><a href="donations_m_[% month %].html">[% month %]: [% donations.by_month.$month.total %] Euros</a></li>
                [%- END -%]
                [%- END -%]
            </ul>
        </div>
    </body>
</html>