X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/6f91863c2a28a8590a6763580062c1d31b43dbec..ac5cb613b0f0a143eaeed801979bfc56e7c88e40:/apps.mlt diff --git a/apps.mlt b/apps.mlt index adec3b6..e3ac4b2 100644 --- a/apps.mlt +++ b/apps.mlt @@ -1,23 +1,54 @@ <% @header [("title", ["Membership applications"])]; val you = Init.getUserId (); -val board = Group.inGroupName "board"; +val board = Group.reallyInGroupName "board"; val root = Group.inGroupNum 0; ref showNormal = true; -if $"vote" <> "" then +if $"show" <> "" then + showNormal := false; + val usr = Web.stoi ($"show"); + val user = Init.lookupUser usr; + val appl = App.lookupApp (#app user) %> + + + + + + + + + + +
Received: <% #applied appl %> (<% Util.diffFromNow (#applied appl) %> ago)
Approved by: <% + ref first = true; + ref found = false; + val votes = App.votes (#id appl); + foreach (id, name) in votes do + if first then + first := false + else + %>, <% + end + %><% name %><% + if id = you then + found := true + %> [Unvote]<% + end + end %> <% if (iff board then not found else false) then %>[Vote]<% end %>
Username: <% #name appl %>
Real name: <% Web.html (#rname appl) %>
E-mail: <% #email appl %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
Other information: <% Web.htmlNl (#other appl) %>
+<% elseif $"vote" <> "" then Group.requireGroupName "board"; App.vote (you, Web.stoi ($"vote")) - %>

Vote registered

<% + %>

Vote registered

<% elseif $"unvote" <> "" then Group.requireGroupName "board"; App.unvote (you, Web.stoi ($"unvote")) - %>

Unvote registered

<% + %>

Unvote registered

<% elseif $"deny" <> "" then showNormal := false; val appl = App.lookupApp (Web.stoi ($"deny")) - %>

Deny application for <% #name appl %>

+ %>

Deny application for <% #name appl %>

"> Reason:
@@ -27,40 +58,119 @@ elseif $"deny" <> "" then elseif $"deny2" <> "" then Group.requireGroupName "board"; if not (App.deny (Web.stoi ($"deny2"), $"msg")) then - %>

Error denying application

<% + %>

Error denying application

<% else - %>

Application denied

<% + %>

Application denied

<% end elseif $"approve" <> "" then showNormal := false; val appl = App.lookupApp (Web.stoi ($"approve")) - %>

Approve application for <% #name appl %>

+ %>

Approve application for <% #name appl %>

"> - Message:
+ Message (will be added at the end of ~hcoop/portal/welcome.txt, so you might want to include some introductory text):

<% elseif $"approve2" <> "" then Group.requireGroupName "board"; if not (App.approve (Web.stoi ($"approve2"), $"msg")) then - %>

Error approving application

<% + %>

Error approving application

<% else - %>

Application approved

<% + %>

Application approved

<% end +elseif $"cmd" = "approved" then + showNormal := false + + %>

Pending applications

<% + + foreach appl in App.listApps [App.ACCEPTED, App.BEING_ADDED] do %> +


+ + + + + + + <% switch #paypal appl of + SOME s => %> + <% end; + switch #checkout appl of + SOME s => %> + <% end %> + + + + <% if #status appl = App.BEING_ADDED then %><% end %> +
Received: <% #applied appl %> (<% Util.diffFromNow (#applied appl) %> ago)
Approved by: <% + ref first = true; + ref found = false; + foreach (id, name) in App.votes (#id appl) do + if first then + first := false + else + %>, <% + end + %><% name %><% + end %>
Username: <% #name appl %>
Real name: <% Web.html (#rname appl) %>
E-mail address: <% #email appl %>
PayPal: <% s %>
Google Checkout: <% s %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
Other information: <% Web.htmlNl (#other appl) %>
WARNING: Someone already followed the add link for this application. Maybe he forgot to finish.
+ + <% if root then %> + Add this member.
+ <% end + end +elseif $"add" <> "" then + Group.requireGroupNum 0; + showNormal := false; + val id = Web.stoi ($"add"); + val appl = App.lookupApp id; + App.preAdd id %> + +First, run this on deleuze: +
new-user <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
+ +
+ + + + + + + + + + +
Name:
Real name:
Funded by:
Initial transaction amount:
Initial transaction description:
Groups:
+
+ +Abort adding this member + +<% elseif $"abort" <> "" then + App.abortAdd (Web.stoi ($"abort")) + %>

Aborted

<% + end %> <% if showNormal then %> -

Pending applications

+

Pending applications

-<% foreach appl in App.listPending () do %> +<% foreach appl in App.listApps [App.PENDING] do %>


- - -
Received: <% #applied appl %>
Approved by: <% + + + - - - - - - + + + + <% switch #paypal appl of + SOME s => %> + <% end; + switch #checkout appl of + SOME s => %> + <% end %> + + +
Received: <% #applied appl %> (<% Util.diffFromNow (#applied appl) %> ago)
Approved by: <% ref first = true; ref found = false; - foreach (id, name) in App.votes (#id appl) do + val votes = App.votes (#id appl); + foreach (id, name) in votes do if first then first := false else @@ -72,19 +182,25 @@ end %> %> [Unvote]<% end end %> <% if (iff board then not found else false) then %>[Vote]<% end %>
Username: <% #name appl %>
Real name: <% Web.html (#rname appl) %>
E-mail address: <% #email appl %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
Other information: <% Web.htmlNl (#other appl) %>
Username: <% #name appl %>
Real name: <% Web.html (#rname appl) %>
E-mail address: <% #email appl %>
PayPal: <% s %>
Google Checkout: <% s %>
Forward e-mail? <% if #forward appl then %>yes<% else %>no<% end %>
Proposed uses: <% Web.htmlNl (#uses appl) %>
Other information: <% Web.htmlNl (#other appl) %>
<% if board then %> - Add this member.
+ <% if length votes >= 3 then %>Approve this member.
<% end %> Deny this application. <% end %> -<% end +<% end end %> -<% @footer[] %> \ No newline at end of file +<% @footer[] %>