aboutsummaryrefslogtreecommitdiffstats
path: root/tmpl/index.json
blob: b6102d7802fee6b2b1c4e6de095a30717b846569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[%- USE JSON ( pretty => 1 ) -%]
[%- USE date(format='%Y/%m/%d') -%]
[%-
   SET out = {};
   SET out.balance = transactions.balance.bstr;
   SET out.donations_30days = donations.total_30.bstr;
   SET out.last_donations = [];
   SET out.last_update = date.format(last_update, format => '%Y/%m/%d %H:%M:%S');
   SET i=0;
   SET l=10;
   FOREACH don IN donations.donations.sort('date').reverse; 
        SET i = i + 1;
        LAST IF i > l;
        SET n = {};
        SET n.pa = don.pa;
        SET n.who = don.who;
        SET n.amount = don.amount.bstr;
        SET n.date = date.format(don.date);
        out.last_donations.push(n);
   END;
-%]
[% out.json -%]