X-Git-Url: https://git.hcoop.net/hcoop/portal.git/blobdiff_plain/d6223be994735931643a8205a2c2c9724640fa21..c1c4be380263b5793c95deb162014930bd8aae6c:/contact.mlt
diff --git a/contact.mlt b/contact.mlt
dissimilarity index 95%
index 0dc61d4..905b9c7 100644
--- a/contact.mlt
+++ b/contact.mlt
@@ -1,5 +1,94 @@
-<% @header[("title", ["Contact information"])] %>
-
-
-
-<% @footer[] %>
\ No newline at end of file
+<% @header[("title", ["Contact information"])];
+
+ref showNormal = true;
+
+if $"cmd" = "add" then
+ val id = Contact.addContact (Init.getUserId(), Web.stoi ($"knd"), $"v", Contact.privFromInt (Web.stoi ($"priv"))) %>
+
Contact added
+
+<% elseif $"mod" <> "" then
+ showNormal := false;
+ val id = Web.stoi ($"mod");
+ val cont = Contact.lookupContact id %>
+
+Modify contact entry
+
+
+
+<% elseif $"save" <> "" then
+ val id = Web.stoi ($"save");
+ val cont = Contact.lookupContact id;
+ Contact.modContact {cont with knd = Web.stoi ($"knd"), v = $"v", priv = Contact.privFromInt (Web.stoi ($"priv"))} %>
+ Contact entry saved
+
+<% elseif $"del" <> "" then
+ showNormal := false;
+ val id = Web.stoi ($"del");
+ val cont = Contact.lookupContact id %>
+ Are you sure you want to delete contact entry "<% Web.html (#v cont) %>"?
+ Yes, delete "<% Web.html (#v cont) %>"!
+
+<% elseif $"del2" <> "" then
+ val id = Web.stoi ($"del2");
+ val cont = Contact.lookupContact id;
+ Contact.deleteContact id %>
+ Contact entry "<% Web.html (#v cont) %>" deleted
+
+<% end;
+
+if showNormal then %>
+
+Add new contact information
+
+
+
+Your contact information
+
+
+<% foreach (kind, cont) in Contact.listUserContacts (Init.getUserId(), Contact.ADMINS) do %>
+ <% Web.html (#name kind) %>: |
+ <% Contact.format (kind, cont) %> |
+ <% switch #priv cont of
+ Contact.PUBLIC => %>Public<%
+ | Contact.MEMBERS => %>Members only<%
+ | Contact.ADMINS => %>Admins only<%
+ end %> |
+ [Modify] [Delete] |
+<% end %>
+
+
+<% end %>
+
+<% @footer[] %>
\ No newline at end of file