Join script should rule out retired usernames
[bpt/portal.git] / pledge.mlt
CommitLineData
8e3b776e
AC
1<% @header [("title", ["Sliding scale pledges"])];
2
3if $"cmd" = "set" then
4 val user = Init.getUser ();
5 val shares = Web.stoi ($"pledge");
6 if shares <= 0 then
7 %><h3>You can't make a non-positive pledge!</h3><%
8 else
9 Init.modUser {user with shares = shares}
10 %><h3>Thank you for your pledge!</h3><%
11 end
12elseif $"cmd" = "calc" then
13 val user = Init.getUser ();
14 val amt = Web.stor ($"amt");
15 val base = Money.costBase amt
16 %><h3>Out of $<% amt %>, you would pay $<% Util.mult (#shares user, base) %> and the lowest share of the cost would be $<% base %>.</h3><%
17end
18
19val user = Init.getUser () %>
20
2cce5767 21<p>Base HCoop membership dues are set at $7/mo.. On this page, you can set a <i>pledge amount</i> above one, so that you pay 7<i>N</i> dollars a month, where <i>N</i> is your pledge amount, to help offset costs for members with more stringent budgets. If the members listed below weren't making extra pledges, we would need to increase the base dues amount of $7 to cover our costs.</p>
5c705bcb
AC
22
23<!--p>HCoop divides expenses among members based on a "sliding scale"-style scheme. We charge you only for our concrete expenses, not adding any expenses beyond what we pay to service providers and vendors. Whenever a concrete expense needs to be paid for, we divide it among the members based on how much each of you has pledged on this web page. Your pledge is a whole number 1 or higher which you can think of as indicating how many times the amount paid by the lowest-contributing members you are willing to pay. Concretely, every expense is divided by the sum of all members' pledges, and each member is charged an amount equal to the result of that division times his pledge number. This way <i>everyone's</i> monthly costs go down automatically as we gain new members.</p-->
8e3b776e
AC
24
25<h2>Set your pledge number</h2>
26<form method="post">
27<input type="hidden" name="cmd" value="set">
28<input name="pledge" size="3" value="<% #shares user %>">
29<input type="submit" value="Set">
30</form>
31
32<h2>Calculate your share of an expense</h2>
5c705bcb
AC
33
34<p>This form is mostly of historical interest, since we've switched to a flat dues scheme.</p>
35
8e3b776e
AC
36<form method="post">
37<input type="hidden" name="cmd" value="calc">
2cce5767 38$<input name="amt" size="7" value="850">
8e3b776e
AC
39<input type="submit" value="Calculate">
40</form>
41
42<h2>Members with pledges above 1</h2>
43
44<table>
45<% foreach usr in Init.byPledge () do %>
46 <tr> <td align="right"><% #shares usr %></td> <td><a href="user?id=<% #id usr %>"><% Web.html (#name usr) %></a></td> </tr>
47<% end %>
48</table>
49
50<% @footer [] %>
51
52