aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl/index.html
blob: 2f1dc38ce8d5d444726efbd695863155d94364aa (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
[%- USE date(format='%Y/%m/%d') -%]
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>[% config.sitename %] treasurer infos</title>
        [%- INCLUDE head.html -%]
        [% INCLUDE head_chart.html %]
    </head>
    <body>
        [%- INCLUDE body_top.html -%]
        <h1 id='mgnavt'>treasurer.mageia.og</h1>

        <div class="content">
            <div class="section">
                <h2>Donations</h2>

                <a href="donations.rss"><img src="[% config.staticdir_url %]/feed-16x16.png" alt="RSS feed" /></a>
                [%- l = 3 -%]
                Last [% l %] donations received :
                <ul>
                    [%- i=0 -%]
                    [%- FOR don IN donations.donations.sort('date').reverse -%]
                    [%- i = i + 1 -%]
                    [%- LAST IF i > l -%]
                    <li><b><a href="donations_p_[% don.pa %].html">[% don.who %]</a></b> donated <b>[% don.amount %]</b> Euros on [% date.format(don.date) %]</li>
                    [%- END -%]
                </ul>

                <a href="donations.html">See more about donations</a>.
            </div>

            <div class="section">
                <h2>Accounts status</h2>

                <ul>
                    <li>Global balances: [% transactions.balance %] Euros</li>
                    [%- FOR ac IN transactions.by_ac.keys -%]
                    <li><a href="a_[% ac %].html">[% transactions.by_ac.$ac.account %]</a>: [% transactions.by_ac.$ac.balance %] Euros</li>
                    [%- END -%]
                </ul>
            </div>

            <div class="section">
                <h2>Expenses and revenues by category</h2>

                [%-
                SET ca_expenses = [];
                SET ca_expenses_names = [];
                SET ca_revenues = [];
                SET ca_revenues_names = [];

                FOREACH ca IN transactions.by_ca.keys.sort;
                        IF transactions.by_ca.$ca.expenses != 0;
                                ca_expenses.push(ca);
                                ca_expenses_names.push(transactions.by_ca.$ca.c_name);
                        END;
                        IF transactions.by_ca.$ca.revenues != 0;
                                ca_revenues.push(ca);
                                ca_revenues_names.push(transactions.by_ca.$ca.c_name);
                        END;
                END;
                -%]

                <h3>Expenses</h3>
                [% IF ca_expenses.size > 1 %]
                <canvas id="expenses_ca_bar_chart" height="300" width="[% 80 + ca_expenses.size * 65 %]"></canvas>

                <script>

                    var barChartDataExpenses = {
                        labels : ["[% ca_expenses_names.join('","') %]"],
                        datasets : [
                        {
                            fillColor : "#e51b1b",
                            strokeColor : "#f11111",
                            data: [
                            [%- FOR ca IN ca_expenses -%]
                            [%- transactions.by_ca.$ca.expenses -%]
                            [%- IF ! loop.last() -%],[%- END -%]
                            [%- END %]]
                        }
                        ]
                        
                    }

                    var myLine = new Chart(document.getElementById("expenses_ca_bar_chart").getContext("2d")).Bar(barChartDataExpenses);

                </script>
                [% END %]
                <ul>
                    [%- FOR ca IN ca_expenses %]
                    <li><b><a href="c_[% ca %].html">[% transactions.by_ca.$ca.c_name %]</a></b>: [% transactions.by_ca.$ca.expenses %] Euros</li>
                    [%- END -%]
                </ul>

                <h3>Revenues</h3>
                [% IF ca_revenues.size > 1 %]
                <canvas id="revenues_ca_bar_chart" height="300" width="[% 80 + ca_revenues.size * 65 %]"></canvas>

                <script>

                    var barChartDataRevenues = {
                        labels : ["[% ca_revenues_names.join('","') %]"],
                        datasets : [
                        {
                            fillColor : "#151f79",
                            strokeColor : "#101333",
                            data: [
                            [%- FOR ca IN ca_revenues -%]
                            [%- transactions.by_ca.$ca.revenues -%]
                            [%- IF ! loop.last() -%],[%- END -%]
                            [%- END %]]
                        }
                        ]
                        
                    }

                    var myLine = new Chart(document.getElementById("revenues_ca_bar_chart").getContext("2d")).Bar(barChartDataRevenues);

                </script>
                [% END %]
                <ul>
                    [%- FOR ca IN ca_revenues %]
                    <li><b><a href="c_[% ca %].html">[% transactions.by_ca.$ca.c_name %]</a></b>: [% transactions.by_ca.$ca.revenues %] Euros</li>
                    [%- END -%]
                </ul>
            </div>

            <div class="section">
                <h2>Accounts history</h2>

                <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> - Expenses: [% transactions.by_year.$year.expenses %] Revenues: [% transactions.by_year.$year.revenues %]</li>
                    [%- END -%]
                </ul>
            </div>

            <div class="section">
                <h2>Who donated money</h2>

                You can find <a href="donations_who.html">a list of people who donated to Mageia.Org</a>.
            </div>

            <div class="section">
                <h2>RSS Feeds</h2>
                <p><a href="donations.rss">Donations RSS Feed <img src="[% config.staticdir_url %]/feed-16x16.png" alt="RSS feed" /></a></p>
                <p><a href="transactions.rss">Transactions RSS Feed <img src="[% config.staticdir_url %]/feed-16x16.png" alt="RSS feed" /></a></p>
            </div>

            <div class="section">
                <h2>JSON data</h2>

                Some data is available in json format :
                <ul>
                    <li><a href="index.json">index.json</a>: balance, donations received in
                    the last 30 days, time of last update and the list of the last 10
                    donations</li>
                    <li><a href="donations_who.json">donations_who.json</a>: list of people
                    who donated money to Mageia.Org.</li>
                </ul>
            </div>

            <div class="section">
                <h2>Grisbi</h2>
                <p>
                Mageia.Org accounts are managed using <a href="http://grisbi.org/">grisbi</a>.
                For more details about Mageia.Org accounts, you can download
                <a href="mageia-accounts.gsb">this file</a>, and open it with grisbi.
                </p>

                <p>
                If you want to receive an email notification when it is updated, you
                can subscribe to the <a href="https://ml.mageia.org/l/info/treasurer-commits">treasurer-commits</a>
                mailing list.
                </p>
            </div>

            <div class="section">
                <h2>Questions</h2>
                For any question related to Mageia.Org accounts or donations you can
                send an email to <a href="mailto:treasurer@mageia.org">treasurer@mageia.org</a>.
            </div>

            <div class="section">
                <h2>Source code</h2>
                Source code for the tools used to generate this website is available on
                Mageia svn repository :

                <p>
                <code>
                    $ svn co <a href="http://svnweb.mageia.org/soft/mga-treasurer/trunk/">
                        svn://svn.mageia.org/svn/soft/mga-treasurer/trunk/</a> mga-treasurer
                </code>
                </p>
            </div>

            <div class="section">
                <small>Last update: [% date.format(last_update, format => '%Y/%m/%d %H:%M:%S') %]</small>
            </div>

        </div>
    </body>
</html>