X-Git-Url: https://git.hcoop.net/bpt/portal.git/blobdiff_plain/d5f8418bc9167e9597c463175b38830ba17624b6..e38fe5b0e18be227d05b0071de8773d4b8c02236:/apps.mlt diff --git a/apps.mlt b/apps.mlt index c59d18a..33fb346 100644 --- a/apps.mlt +++ b/apps.mlt @@ -1,12 +1,42 @@ <% @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) %>
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

<% @@ -37,7 +67,7 @@ elseif $"approve" <> "" then %>

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):

<% @@ -53,10 +83,10 @@ elseif $"cmd" = "approved" then %>

Pending applications

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


- + + <% if #status appl = App.BEING_ADDED then %><% end %>
Received: <% #applied appl %>
Received: <% #applied appl %> (<% Util.diffFromNow (#applied appl) %> ago)
Approved by: <% ref first = true; ref found = false; @@ -80,6 +110,7 @@ elseif $"cmd" = "approved" then
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 %> @@ -91,10 +122,10 @@ elseif $"add" <> "" then showNormal := false; val id = Web.stoi ($"add"); val appl = App.lookupApp id; - App.add id %> + App.preAdd id %> First, run this on deleuze: -
magic-create-user-wrapper <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
+
new-user <% #name appl %> "<% #rname appl %>"<% if #forward appl then %> "<% #email appl %>"<% end %>
@@ -109,7 +140,7 @@ First, run this on deleuze: Initial transaction amount: Initial transaction description: - Subscribe to hcoop-announce + Groups: