payment: note that Stripe has instituted an additional 1% fee for non-US cards
[hcoop/portal.git] / portal.mlt
dissimilarity index 70%
index 015def3..9cda623 100644 (file)
@@ -1,85 +1,94 @@
-<% val you = Init.getUser();
-val bal = Balance.lookupBalance (#bal you);
-@header [] %>
-
-<% if Group.inGroupNum 0 then %>
-<b><h3>Admin</h3></b>
-<a href="apps?cmd=approved">Approved applicants waiting for accounts</a><br>
-<a href="users">Members</a><br>
-<a href="groups">Groups</a><br>
-<a href="balances">Balances</a><br>
-<a href="kind">Contact kinds</a><br>
-<a href="roll">Roll call!</a><br>
-<% end %>
-
-<b><h3>Your account</h3></b>
-
-<a href="pref">Preferences</a><br>
-<a href="money">Financial</a><br>
-<a href="sec">Security settings</a><br>
-<a href="contact">Contact information</a><br>
-<a href="location">Your geographic locations</a><br>
-<a href="link">Public URL directory</a><br>
-
-<b><h3>Support requests</h3></b>
-
-<a href="domain">Request control of a domain with domtool</a><br>
-<a href="apt">Request Debian apt packages</a><br>
-<a href="list">Request a Mailman mailing list</a><br>
-<a href="support">Other support request</a><br>
-
-<h3><b><a href="money">Your recent account activity</a></b></h3>
-
-<table>
-<tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> </tr>
-<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 5) do %>
-<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% amount %>/<% #amount trn %></td> </tr>
-<% end %>
-</table>
-<b>Balance: $<% #amount bal %></b>
-
-<h3><b><a href="poll">Current polls</a></b></h3>
-
-<% foreach pol in Poll.listCurrentPolls () do %>
-<li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
-<% if Poll.takingVotes pol then %><a href="poll?vote=<% #id pol %>">[VOTE]</a><% end %>
-(<% Web.html (#starts pol) %> to <% Web.html (#ends pol) %>)</li>
-<% end %>
-
-<h3><b><a href="support">Open support issues</a></b></h3>
-
-<% foreach (name, issue) in Support.listOpenIssues (#id you) do %>
-<a href="user?id=<% #usr issue %>"><% name %></a>: <a href="issue?cat=<% #cat issue %>&id=<% #id issue %>"><% Web.html (#title issue) %></a>
-<% switch #status issue of
-         Support.NEW => %>(New)<%
-       | Support.PENDING => %>(Pending)<%
-       | Support.CLOSED => %>(Closed)<%
-end %>
-<br>
-<% end %>
-
-<h3><b>Statistics</b></h3>
-
-<a href="webbw">Apache bandwidth</a><br>
-<a href="quotas">Disk usage</a><br>
-
-<h3><b>Public pages</b></h3>
-
-<a href="http://hcoop.net/dyn/members.html">Member directory</a><br>
-<a href="http://hcoop.net/dyn/locs.html">Member location summary</a><br>
-<a href="http://hcoop.net/dyn/sites.html">URL directory</a><br>
-
-<h3><b>Miscellaneous</b></h3>
-
-<a href="apps">Review pending membership applications</a><br>
-<a href="dir">Contact information directory</a><br>
-<a href="poll">Polls</a><br>
-
-<h3><b>Other services</b></h3>
-
-<a href="/webalizer/">Webalizer</a><br>
-<a href="/mrtg/">MRTG statistics</a><br>
-<a href="/usermin/">Usermin</a><br>
-<a href="/squirrel/">SquirrelMail</a><br>
-
-<% @footer [] %>
\ No newline at end of file
+<% val you = Init.getUser();
+val bal = Balance.lookupBalance (#bal you);
+val deposit = Balance.depositAmount (#id bal);
+val showBal = Util.sub (#amount bal, deposit);
+@header [] %>
+
+<!--
+<div class="news">
+
+<h3>Welcome to the Portal On Navajos</h3>
+
+<p><a href="https://wiki.hcoop.net/Hardware#deleuze">Deleuze</a>
+suffered a hardware failure, and the benefit is that the portal is now
+running on our Debian Wheezy web server. List preferences are
+temporarily non-functional, email <a
+href="mailto:admins@hcoop.net"><tt>admins@hcoop.net</tt></a> if you
+would like to change your hcoop list subscriptions.</p>
+
+</div>
+-->
+
+<% @payment [] %>
+
+<h3><a href="money">Your recent account activity</a></h3>
+
+<% ref running = showBal %>
+<table class="data">
+<tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Balance</b></td></tr>
+<% foreach (amount, trn) in Money.listUserTransactionsLimit (Init.getUserId (), 5) do %>
+<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>
+<td style="text-align: right"><% running %></td></tr>
+<% running := Util.sub (running, amount)
+end %>
+</table>
+<a href="money?lookback=inf">Show all transactions</a><br>
+<b>Balance: $<% showBal %></b><br>
+<b>Deposit: $<% deposit %></b> (3 months of dues at the minimal <a href="pledge">pledge level</a>)
+
+<h3>Pending Stripe Payments</h3>
+
+<table>
+<tr><td><strong>Date</strong></td><td><strong>Net Amount</strong> (After Fees)</td></tr>
+<% foreach stripePmt in Money.listUserPendingStripePayments
+       (Init.getUserId () ) do %>
+<tr>
+  <td><% #paid_on stripePmt %></td>
+  <td style="text-align: right">$<% #net stripePmt %></td>
+</tr>
+<% end %>
+</table>
+
+
+<!--b>Balance: $<% #amount bal %></b-->
+
+<% val polls = Poll.listCurrentPolls ();
+switch polls of
+       _::_ => %>
+<h3><a href="poll">Current polls</a></h3>
+
+<% foreach pol in polls do %>
+<li> <a href="poll?id=<% #id pol %>"><% Web.html (#title pol) %></a>
+<% if Poll.takingVotes pol then %><a href="poll?vote=<% #id pol %>">[VOTE]</a><% end %>
+(<% Web.html (#starts pol) %> to <% Web.html (#ends pol) %>)</li>
+<% end
+end %>
+
+<% val issues = Support.listOpenIssues (#id you);
+switch issues of
+       _::_ => %>
+<h3><a href="support">Open support issues</a></h3>
+
+<% foreach (name, issue) in issues do %>
+<a href="user?id=<% #usr issue %>"><% name %></a>: <a href="issue?cat=<% #cat issue %>&id=<% #id issue %>"><% Web.html (#title issue) %></a>
+<% switch #status issue of
+         Support.NEW => %>(New)<%
+       | Support.PENDING => %>(Pending)<%
+       | Support.CLOSED => %>(Closed)<%
+end %>
+<br>
+<% end
+end;
+
+val {total, vhosts} = Stats.getWebbwUser {user = Init.getUserName (), last = 0};
+switch vhosts of
+       _ :: _ =>
+       %><h3>Your web traffic this month</h3>
+       <table class="data"><tr><th>Site</th> <th>Data transferred (kB)</th></tr><%
+       foreach e in vhosts do %>
+                      <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>
+       <% end %>
+       </table>
+<% end;
+
+@footer [] %>