Specify host for database connections
[hcoop/portal.git] / portal.mlt
1 <% val you = Init.getUser();
2 val bal = Balance.lookupBalance (#bal you);
3 val deposit = Balance.depositAmount (#id bal);
4 val showBal = Util.sub (#amount bal, deposit);
5 @header [] %>
6
7 <% @payment [] %>
8
9 <h3><a href="money">Your recent account activity</a></h3>
10
11 <% ref running = showBal %>
12 <table>
13 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Balance</b></td></tr>
14 <% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 5) do %>
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)
18 end %>
19 </table>
20 <a href="money?lookback=inf">Show all transactions</a><br>
21 <b>Balance: $<% showBal %></b><br>
22 <b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
23
24 <!--b>Balance: $<% #amount bal %></b-->
25
26 <% val polls = Poll.listCurrentPolls ();
27 switch polls of
28 _::_ => %>
29 <h3><a href="poll">Current polls</a></h3>
30
31 <% foreach pol in polls do %>
32 <li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
33 <% if Poll.takingVotes pol then %><a href="poll?vote=<% #id pol %>">[VOTE]</a><% end %>
34 (<% Web.html (#starts pol) %> to <% Web.html (#ends pol) %>)</li>
35 <% end
36 end %>
37
38 <% val issues = Support.listOpenIssues (#id you);
39 switch issues of
40 _::_ => %>
41 <h3><a href="support">Open support issues</a></h3>
42
43 <% foreach (name, issue) in issues do %>
44 <a href="user?id=<% #usr issue %>"><% name %></a>: <a href="issue?cat=<% #cat issue %>&id=<% #id issue %>"><% Web.html (#title issue) %></a>
45 <% switch #status issue of
46 Support.NEW => %>(New)<%
47 | Support.PENDING => %>(Pending)<%
48 | Support.CLOSED => %>(Closed)<%
49 end %>
50 <br>
51 <% end
52 end;
53
54 val {total, vhosts} = Stats.getWebbwUser {user = Init.getUserName (), last = 0};
55 switch vhosts of
56 _ :: _ =>
57 %><h3>Your web traffic this month</h3>
58 <table><tr><th>Site</th> <th>Data transferred (kB)</th></tr><%
59 foreach e in vhosts do %>
60 <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>
61 <% end %>
62 </table>
63 <% end;
64
65 @footer [] %>