Improve long table display
[hcoop/portal.git] / money.mlt
index e846c3f..9129de9 100644 (file)
--- a/money.mlt
+++ b/money.mlt
@@ -7,7 +7,7 @@ ref showNormal = true;
 if $"hist" <> "" then
        showNormal := false;
        val id = Web.stoi ($"hist") %>
-<table>
+<table class="data">
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> </tr>
 <% foreach (amount, trn) in Money.listUserTransactions id 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>
@@ -20,7 +20,7 @@ if $"hist" <> "" then
 
 <h3>Transactions</h3>
 
-<table>
+<table class="data">
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Last modified</b></td> <td><b>Participants</b></td> </tr>
 <% foreach trn in Money.listTransactions () do %>
 <tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% #amount trn %></td> <td><% #stamp trn %></td>
@@ -42,10 +42,10 @@ end %>
 
 <h3>Primary Transactions</h3>
 
-<table>
+<table class="data">
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Last modified</b></td> <td><b>Participants</b></td> </tr>
 <% foreach (amt, trn) in Money.listUserTransactions (valOf (Init.userNameToId "hcoop")) do %>
-<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% #amount trn %></td> <td><% #stamp trn %></td>
+<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td style="text-align: right"><% #amount trn %></td> <td><% #stamp trn %></td>
 <% switch Money.listChargesWithNames (#id trn) of
          [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td><%
        | _ => %><td><i>multi</i></td><%
@@ -579,7 +579,7 @@ elseif $"cmd" = "checkout" then
 elseif $"cmd" = "delinq" then
        showNormal := false;
        val dqs = Money.delinquentPledgers () %>
-<table>
+<table class="data">
 <tr> <th>Member</th> <th>Pledge</th> <th>Balance</th> </tr>
 <% foreach dq in dqs do %>
 <tr> <td><a href="user?id=<% #id dq %>"><% #name dq %></a></td> <td><% #shares dq %></td> <td>$<% #balance dq %></td> </tr>
@@ -670,7 +670,7 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI
 
 <h3>Apply Stripe Payments</h3>
 
-<table>
+<table class="data">
 <tr><td><strong>Date</strong></td><td><strong>Member</strong></td>
     <td><strong>Name on Card</strong></td>
     <td><strong>Amount</strong> (After Fees)</td><td><td></td>
@@ -681,7 +681,7 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI
   <td><% #name (Init.lookupUser (#webuser_id stripePmt)) %></td>
   <td><% #paid_on stripePmt %></td>
   <td><% #card_name stripePmt %>
-  <td>$<% #net stripePmt %></td>
+  <td style="text-align: right">$<% #net stripePmt %></td>
   <td><form method="post">
         <input type="hidden" name="cmd" value="stripeApply" />
         <input type="hidden" name="stripeId" value="<% #charge_id stripePmt %>" />
@@ -696,10 +696,10 @@ Co-op balance: $<% #amount (Balance.lookupBalance (valOf (Balance.balanceNameToI
 
 
 
-<table>
+<table class="data">
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Amount</b></td> <td><b>Participants</b></td> <td><b>Replace</b></td> <td><b>Delete</b></td> </tr>
 <% foreach trn in Money.listTransactionsLimit 20 do %>
-<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td><% #amount trn %></td>
+<tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td> <td style="text-align: right"><% #amount trn %></td>
 <% switch Money.listChargesWithNames (#id trn) of
          [(name, cha)] => %><td><a href="user?id=<% #usr cha %>"><% name %></a></td><%
        | _ => %><td><i>multi</i></td><%
@@ -726,13 +726,13 @@ val trans = iff lookback = 0 then
         Money.listUserTransactions (Init.getUserId ())
     else
        Money.listUserTransactionsLimit (Init.getUserId (), lookback) %>
-<table>
+<table class="data">
 <tr> <td><b>Date</b></td> <td><b>Description</b></td> <td><b>Debit</b></td> <td><b>Credit</b></td> <td><b>Balance</b></td></tr>
 <% foreach (amount, trn) in trans do %>
 <tr> <td><% #d trn %></td> <td><a href="money?trn=<% #id trn %>"><% Web.html (#descr trn) %></a></td>
-<td align="right"><% if Util.lt (amount, 0.0) then %><% amount %><% end %></td>
-<td align="right"><% if Util.ge (amount, 0.0) then %><% amount %><% end %></td>
-<td><% running %></tr>
+<td style="text-align: right"><% if Util.lt (amount, 0.0) then %><% amount %><% end %></td>
+<td style="text-align: right"><% if Util.ge (amount, 0.0) then %><% amount %><% end %></td>
+<td style="text-align: right"><% running %></tr>
 <% running := Util.sub (running, amount)
 end %>
 </table>