blob: 686732b55b22048947848a4729f3b30eeeb8c578 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
[%- 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.donations_total = donations.total.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 -%]
|