payment: note that Stripe has instituted an additional 1% fee for non-US cards
[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 <!--
8 <div class="news">
9
10 <h3>Welcome to the Portal On Navajos</h3>
11
12 <p><a href="https://wiki.hcoop.net/Hardware#deleuze">Deleuze</a>
13 suffered a hardware failure, and the benefit is that the portal is now
14 running on our Debian Wheezy web server. List preferences are
15 temporarily non-functional, email <a
16 href="mailto:admins@hcoop.net"><tt>admins@hcoop.net</tt></a> if you
17 would like to change your hcoop list subscriptions.</p>
18
19 </div>
20 -->
21
22 <% @payment [] %>
23
24 <h3><a href="money">Your recent account activity</a></h3>
25
26 <% ref running = showBal %>
27 <table class="data">
28 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Balance</b></td></tr>
29 <% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 5) do %>
30 <tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td style="text-align: right"><% amount %>/<% #amount trn %></td>
31 <td style="text-align: right"><% running %></td></tr>
32 <% running := Util.sub (running, amount)
33 end %>
34 </table>
35 <a href="money?lookback=inf">Show all transactions</a><br>
36 <b>Balance: $<% showBal %></b><br>
37 <b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
38
39 <h3>Pending Stripe Payments</h3>
40
41 <table>
42 <tr><td><strong>Date</strong></td><td><strong>Net Amount</strong> (After Fees)</td></tr>
43 <% foreach stripePmt in Money.listUserPendingStripePayments
44 (Init.getUserId () ) do %>
45 <tr>
46 <td><% #paid_on stripePmt %></td>
47 <td style="text-align: right">$<% #net stripePmt %></td>
48 </tr>
49 <% end %>
50 </table>
51
52
53 <!--b>Balance: $<% #amount bal %></b-->
54
55 <% val polls = Poll.listCurrentPolls ();
56 switch polls of
57 _::_ => %>
58 <h3><a href="poll">Current polls</a></h3>
59
60 <% foreach pol in polls do %>
61 <li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
62 <% if Poll.takingVotes pol then %><a href="poll?vote=<% #id pol %>">[VOTE]</a><% end %>
63 (<% Web.html (#starts pol) %> to <% Web.html (#ends pol) %>)</li>
64 <% end
65 end %>
66
67 <% val issues = Support.listOpenIssues (#id you);
68 switch issues of
69 _::_ => %>
70 <h3><a href="support">Open support issues</a></h3>
71
72 <% foreach (name, issue) in issues do %>
73 <a href="user?id=<% #usr issue %>"><% name %></a>: <a href="issue?cat=<% #cat issue %>&id=<% #id issue %>"><% Web.html (#title issue) %></a>
74 <% switch #status issue of
75 Support.NEW => %>(New)<%
76 | Support.PENDING => %>(Pending)<%
77 | Support.CLOSED => %>(Closed)<%
78 end %>
79 <br>
80 <% end
81 end;
82
83 val {total, vhosts} = Stats.getWebbwUser {user = Init.getUserName (), last = 0};
84 switch vhosts of
85 _ :: _ =>
86 %><h3>Your web traffic this month</h3>
87 <table class="data"><tr><th>Site</th> <th>Data transferred (kB)</th></tr><%
88 foreach e in vhosts do %>
89 <tr><td style="text-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 style="text-align: right"><% #size e %></td></tr>
90 <% end %>
91 </table>
92 <% end;
93
94 @footer [] %>