release portal3 into production
[hcoop/portal.git] / user.mlt
dissimilarity index 64%
index 498fc49..b590b64 100644 (file)
--- a/user.mlt
+++ b/user.mlt
@@ -1,25 +1,57 @@
-<% val id = Web.stoi ($"id");
-val user = Init.lookupUser id;
-
-@header[("title", [#name user])] %>
-
-<table>
-<tr> <td align="right"><b>Member</b>:</td> <td><% #name user %></td> </tr>
-<tr> <td align="right"><b>Real name</b>:</td> <td><% Web.html (#rname user) %></td> </tr>
-<tr> <td align="right"><b>Hcoop e-mail</b>:</td> <td><a href="mailto:<% #name user %>@hcoop.net"><tt><% #name user %>@hcoop.net</tt></a></td> </tr>
-<tr> <td align="right"><b>Joined</b>:</td> <td><% #joined user %></td> </tr>
-
-<tr> </tr>
-
-<tr> <td><b>Contact information</b></td> </tr>
-
-<% val level = iff Group.inGroupName "contact" then Contact.ADMINS else Contact.MEMBERS;
-
-foreach (kind, cont) in Contact.listUserContacts (id, level) do %>
-       <tr> <td align="right" valign="top"><b><% Web.html (#name kind) %></b>:</td>
-       <td><% Contact.format (kind, cont) %></td> </tr>
-<% end %>
-
-</table>
-
-<% @footer[] %>
+<% val id = Web.stoi ($"id");
+val user = Init.lookupUser id;
+
+@header[("title", [#name user])] %>
+
+<table class="blanks">
+<tr> <td>Member:</td> <td><% #name user %></td> </tr>
+<tr> <td>Real name:</td> <td><% Web.html (#rname user) %></td> </tr>
+<tr> <td>Hcoop e-mail:</td> <td><a href="mailto:<% #name user %><% Init.emailSuffix %>"><tt><% #name user %><% Init.emailSuffix %></tt></a></td> </tr>
+<tr> <td>Joined:</td> <td><% #joined user %></td> </tr>
+<tr> <td>Locations:</td> <td><%
+       ref first = true;
+       foreach loc in Location.userLocations id do
+               if first then
+                       first := false
+               else
+                       %>, <%
+               end
+               %><a href="location?id=<% #id loc %>"><% Web.html (#name loc) %></a><%
+       end %></td> </tr>
+
+<% val links = Link.listUserLinks id;
+
+switch links of
+       (_::_) => %>
+<tr> </tr>
+
+<tr> <td><b>Hosted sites</b></td> </tr>
+
+<% foreach link in links do %>
+       <tr> <td></td> <td><b><a href="<% Web.html (#url link) %>"><% Web.html (#title link) %></a></b><%
+               if #descr link <> "" then %>: <% Web.html (#descr link) end
+       %></td> </tr>
+<% end
+end;
+
+val level = iff Group.inGroupName "contact" then Contact.ADMINS else Contact.MEMBERS;
+
+val contacts = Contact.listUserContacts (id, level);
+
+switch contacts of
+       (_::_) => %>
+<tr> </tr>
+
+<tr> <td><b>Contact information</b></td> </tr>
+
+<% foreach (kind, cont) in contacts  do %>
+       <tr> <td align="right" valign="top"><b><% Web.html (#name kind) %></b>:</td>
+       <td><% Contact.format (kind, cont) %></td> </tr>
+<% end
+end %>
+
+</table>
+
+<p><a href="apps?show=<% id %>">Show archived membership application</a></p>
+
+<% @footer[] %>