Show running balances on transaction summaries
[bpt/portal.git] / portal.mlt
CommitLineData
e68ddb80
AC
1<% val you = Init.getUser();
2val bal = Balance.lookupBalance (#bal you);
466c5944 3val deposit = Balance.depositAmount (#id bal);
b5dc79ca 4val showBal = Util.sub (#amount bal, deposit);
e68ddb80 5@header [] %>
208e2cbc 6
cf10853e 7<% @payment [] %>
17f5503e 8
b6dd1aaf 9<h3><a href="money">Your recent account activity</a></h3>
f49e1088 10
b5dc79ca 11<% ref running = showBal %>
f49e1088 12<table>
b5dc79ca 13<tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Balance</b></td></tr>
f49e1088 14<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 5) do %>
b5dc79ca
AC
15<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% amount %>/<% #amount trn %></td>
16<td><% running %></tr>
17<% running := Util.sub (running, amount)
18end %>
f49e1088 19</table>
b5dc79ca 20<b>Balance: $<% showBal %></b><br>
c8abf2d9 21<b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
96bd398e 22
c8abf2d9 23<!--b>Balance: $<% #amount bal %></b-->
208e2cbc 24
b6dd1aaf
AC
25<% val polls = Poll.listCurrentPolls ();
26switch polls of
27 _::_ => %>
28<h3><a href="poll">Current polls</a></h3>
56dbfc30 29
b6dd1aaf 30<% foreach pol in polls do %>
56dbfc30
AC
31<li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
32<% if Poll.takingVotes pol then %><a href="poll?vote=<% #id pol %>">[VOTE]</a><% end %>
33(<% Web.html (#starts pol) %> to <% Web.html (#ends pol) %>)</li>
b6dd1aaf
AC
34<% end
35end %>
56dbfc30 36
b6dd1aaf
AC
37<% val issues = Support.listOpenIssues (#id you);
38switch issues of
39 _::_ => %>
40<h3><a href="support">Open support issues</a></h3>
5d851d7c 41
b6dd1aaf 42<% foreach (name, issue) in issues do %>
5d851d7c
AC
43<a href="user?id=<% #usr issue %>"><% name %></a>: <a href="issue?cat=<% #cat issue %>&id=<% #id issue %>"><% Web.html (#title issue) %></a>
44<% switch #status issue of
45 Support.NEW => %>(New)<%
46 | Support.PENDING => %>(Pending)<%
47 | Support.CLOSED => %>(Closed)<%
48end %>
49<br>
b6dd1aaf 50<% end
d5f8418b 51end;
eaa96514 52
432aa258
AC
53val {total, vhosts} = Stats.getWebbwUser {user = Init.getUserName (), last = 0};
54switch vhosts of
55 _ :: _ =>
56 %><h3>Your web traffic this month</h3>
57 <table><tr><th>Site</th> <th>Data transferred (kB)</th></tr><%
58 foreach e in vhosts do %>
59 <tr><td align="right"><a href="<% if #ssl (#host e) then %>https<% else %>http<% end %>://<% #hostname (#host e) %>/"><% #hostname (#host e) %><% if #ssl (#host e) then %> (SSL)<% end %></a> <a href="/webalizer/<% #id (#host e) %>/">[detail]</a></td><td><% #size e %></td></tr>
60 <% end %>
61 </table>
62<% end;
63
d5f8418b 64@footer [] %>