1 <% @header [("title", ["Membership applications"])];
3 val you = Init.getUserId ();
4 val board = Group.inGroupName "board";
5 val root = Group.inGroupNum 0;
11 val usr = Web.stoi ($"show");
12 val user = Init.lookupUser usr;
13 val appl = App.lookupApp (#app user) %>
15 <table class="blanks">
16 <tr> <td>Received:</td> <td><% #applied appl %></td> </tr>
17 <tr> <td>Approved by:</td> <td><%
20 val votes = App.votes (#id appl);
21 foreach (id, name) in votes do
27 %><a href="user?id=<% id %>"><% name %></a><%
30 %> <a href="apps?unvote=<% #id appl %>">[Unvote]</a><%
32 end %> <% if (iff board then not found else false) then %><a href="apps?vote=<% #id appl %>">[Vote]</a><% end %></td> </tr>
33 <tr> <td>Username:</td> <td><% #name appl %></td> </tr>
34 <tr> <td>Real name:</td> <td><% Web.html (#rname appl) %></td> </tr>
35 <tr> <td>Forward e-mail?</td> <td><% if #forward appl then %>yes<% else %>no<% end %></td> </tr>
36 <tr> <td>Proposed uses:</td> <td><% Web.htmlNl (#uses appl) %></td> </tr>
37 <tr> <td>Other information:</td> <td><% Web.htmlNl (#other appl) %></td> </tr>
39 <% elseif $"vote" <> "" then
40 Group.requireGroupName "board";
41 App.vote (you, Web.stoi ($"vote"))
42 %><h3>Vote registered</h3><%
43 elseif $"unvote" <> "" then
44 Group.requireGroupName "board";
45 App.unvote (you, Web.stoi ($"unvote"))
46 %><h3>Unvote registered</h3><%
47 elseif $"deny" <> "" then
49 val appl = App.lookupApp (Web.stoi ($"deny"))
50 %><h3>Deny application for <% #name appl %></h3>
51 <form action="apps" method="post">
52 <input type="hidden" name="deny2" value="<% $"deny" %>">
54 <textarea name="msg" rows="5" cols="80" wrap="soft"></textarea><br>
55 <input type="submit" value="Submit">
57 elseif $"deny2" <> "" then
58 Group.requireGroupName "board";
59 if not (App.deny (Web.stoi ($"deny2"), $"msg")) then
60 %><h3>Error denying application</h3><%
62 %><h3>Application denied</h3><%
64 elseif $"approve" <> "" then
66 val appl = App.lookupApp (Web.stoi ($"approve"))
67 %><h3>Approve application for <% #name appl %></h3>
68 <form action="apps" method="post">
69 <input type="hidden" name="approve2" value="<% $"approve" %>">
70 <b>Message</b> (will be added at the end of <tt>~hcoop/portal/welcome.txt</tt>, so you might want to include some introductory text):<br>
71 <textarea name="msg" rows="5" cols="80" wrap="soft"></textarea><br>
72 <input type="submit" value="Submit">
74 elseif $"approve2" <> "" then
75 Group.requireGroupName "board";
76 if not (App.approve (Web.stoi ($"approve2"), $"msg")) then
77 %><h3>Error approving application</h3><%
79 %><h3>Application approved</h3><%
81 elseif $"cmd" = "approved" then
84 %><h3>Pending applications</h3><%
86 foreach appl in App.listApps App.ACCEPTED do %>
88 <table class="blanks">
89 <tr> <td>Received:</td> <td><% #applied appl %></td> </tr>
90 <tr> <td>Approved by:</td> <td><%
93 foreach (id, name) in App.votes (#id appl) do
99 %><a href="user?id=<% id %>"><% name %></a><%
101 <tr> <td>Username:</td> <td><% #name appl %></td> </tr>
102 <tr> <td>Real name:</td> <td><% Web.html (#rname appl) %></td> </tr>
103 <tr> <td>E-mail address:</td> <td><a href="mailto:<% #email appl %>"><% #email appl %></a></td> </tr>
104 <% switch #paypal appl of
105 SOME s => %><tr> <td>PayPal:</td> <td><a href="mailto:<% s %>"><% s %></a></td> </tr>
107 switch #checkout appl of
108 SOME s => %><tr> <td>Google Checkout:</td> <td><a href="mailto:<% s %>"><% s %></a></td> </tr>
110 <tr> <td>Forward e-mail?</td> <td><% if #forward appl then %>yes<% else %>no<% end %></td> </tr>
111 <tr> <td>Proposed uses:</td> <td><% Web.htmlNl (#uses appl) %></td> </tr>
112 <tr> <td>Other information:</td> <td><% Web.htmlNl (#other appl) %></td> </tr>
116 <a href="apps?add=<% #id appl %>">Add this member.</a><br>
119 elseif $"add" <> "" then
120 Group.requireGroupNum 0;
122 val id = Web.stoi ($"add");
123 val appl = App.lookupApp id;
126 First, run this on deleuze:
127 <blockquote><tt>new-user <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %></tt></blockquote>
129 <form action="users" method="post">
130 <input type="hidden" name="app" value="<% #id appl %>">
131 <table class="blanks">
132 <tr> <td>Name:</td> <td><input name="name" value="<% Web.html (#name appl) %>"></td> </tr>
133 <tr> <td>Real name:</td> <td><input name="rname" value="<% Web.html (#rname appl) %>"></td> </tr>
134 <tr> <td>Funded by:</td> <td><select name="bal">
135 <option value="">A new balance</option>
136 <% foreach bal in Balance.listBalances () do %>
137 <option value="<% #id bal %>"><% Web.html (#name bal) %></option>
140 <tr> <td>Initial transaction amount:</td> <td><input name="amount"></td> </tr>
141 <tr> <td>Initial transaction description:</td> <td><input name="descr"></td> </tr>
142 <!--tr> <td><input type="checkbox" name="subscribe" checked></td> <td>Subscribe to hcoop-announce</td> </tr-->
143 <tr> <td>Groups:</td> <td><select name="grp" size="5" multiple>
144 <% foreach group in Group.listGroups () do %>
145 <option value="<% #id group %>"<% if #name group = "paying" then %> selected<% end %>><% Web.html (#name group) %></option>
148 <tr> <td><input type="submit" name="cmd" value="Create"></td> </tr>
152 <a href="apps?abort=<% #id appl %>">Abort adding this member</a>
154 <% elseif $"abort" <> "" then
155 App.abortAdd (Web.stoi ($"abort"))
160 <% if showNormal then %>
161 <h3>Pending applications</h3>
163 <% foreach appl in App.listApps App.PENDING do %>
165 <table class="blanks">
166 <tr> <td>Received:</td> <td><% #applied appl %></td> </tr>
167 <tr> <td>Approved by:</td> <td><%
170 val votes = App.votes (#id appl);
171 foreach (id, name) in votes do
177 %><a href="user?id=<% id %>"><% name %></a><%
180 %> <a href="apps?unvote=<% #id appl %>">[Unvote]</a><%
182 end %> <% if (iff board then not found else false) then %><a href="apps?vote=<% #id appl %>">[Vote]</a><% end %></td> </tr>
183 <tr> <td>Username:</td> <td><% #name appl %></td> </tr>
184 <tr> <td>Real name:</td> <td><% Web.html (#rname appl) %></td> </tr>
185 <tr> <td>E-mail address:</td> <td><a href="mailto:<% #email appl %>"><% #email appl %></a></td> </tr>
186 <% switch #paypal appl of
187 SOME s => %><tr> <td>PayPal:</td> <td><a href="mailto:<% s %>"><% s %></a></td> </tr>
189 switch #checkout appl of
190 SOME s => %><tr> <td>Google Checkout:</td> <td><a href="mailto:<% s %>"><% s %></a></td> </tr>
192 <tr> <td>Forward e-mail?</td> <td><% if #forward appl then %>yes<% else %>no<% end %></td> </tr>
193 <tr> <td>Proposed uses:</td> <td><% Web.htmlNl (#uses appl) %></td> </tr>
194 <tr> <td>Other information:</td> <td><% Web.htmlNl (#other appl) %></td> </tr>
198 <% if length votes >= 2 then %><a href="apps?approve=<% #id appl %>">Approve this member.</a><br><% end %>
199 <a href="apps?deny=<% #id appl %>">Deny this application.</a>