Increase domain component length limit
[hcoop/zz_old/portal.git] / apt.mlt
diff --git a/apt.mlt b/apt.mlt
index 515e97a..0679155 100644 (file)
--- a/apt.mlt
+++ b/apt.mlt
@@ -56,26 +56,26 @@ elseif $"req" <> "" then
        end;
 
        if ok then
-               val id = Apt.addRequest (Init.getUserId(), $"req", $"msg");
+               val id = Apt.add (Init.getUserId(), $"req", $"msg");
                if not (Apt.notifyNew id) then
-                       %><h3><b>Error sending e-mail notification</b></h3><%
+                       %><h3>Error sending e-mail notification</h3><%
                end
-               %><h3><b>Request added</b></h3><%
+               %><h3>Request added</h3><%
        end
 
 elseif $"cmd" = "open" then
-       %><h3><b>Open requests</b></h3>
+       %><h3>Open requests</h3>
        <a href="apt?cmd=list">List all requests</a><%
 
-       foreach (name, req) in Apt.listOpenRequests () do %>
+       foreach (name, req) in Apt.listOpen () do %>
 <br><hr><br>
-<table>
-<tr> <td align="right"><b>By</b>:</td> <td colspan="2"><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
-<tr> <td align="right"><b>Time</b>:</td> <td colspan="2"><% #stamp req %></td> </tr>
-<tr> <td align="right"><b>Packages</b>:</td><%
+<table class="blanks">
+<tr> <td>By:</td> <td colspan="2"><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
+<tr> <td>Time:</td> <td colspan="2"><% #stamp req %></td> </tr>
+<tr> <td>Packages:</td><%
        ref first = true;
 
-       val pkgs = String.tokens Char.isSpace (#pkgs req);
+       val pkgs = String.tokens Char.isSpace (#data req);
 
        foreach pkg in pkgs do
                if first then
@@ -92,7 +92,7 @@ elseif $"cmd" = "open" then
                end
        end %>
 </tr>
-<tr> <td align="right" valign="top"><b>Reason</b>:</td> <td colspan="2"><% Web.html (#msg req) %></td> </tr>
+<tr> <td>Reason:</td> <td colspan="2"><% Web.html (#msg req) %></td> </tr>
 </table>
 
 <% if admin then %>
@@ -105,17 +105,17 @@ elseif $"cmd" = "open" then
 <%     end
 
 elseif $"cmd" = "list" then
-       %><h3><b>All requests</b></h3><%
+       %><h3>All requests</h3><%
 
-       foreach (name, req) in Apt.listRequests () do %>
+       foreach (name, req) in Apt.list () do %>
 <br><hr><br>
-<table>
-<tr> <td align="right"><b>By</b>:</td> <td colspan="2"><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
-<tr> <td align="right"><b>Time</b>:</td> <td colspan="2"><% #stamp req %></td> </tr>
-<tr> <td align="right"><b>Packages</b>:</td><%
+<table class="blanks">
+<tr> <td>By:</td> <td colspan="2"><a href="user?id=<% #usr req %>"><% name %></a></td> </tr>
+<tr> <td>Time:</td> <td colspan="2"><% #stamp req %></td> </tr>
+<tr> <td>Packages:</td><%
        ref first = true;
 
-       val pkgs = String.tokens Char.isSpace (#pkgs req);
+       val pkgs = String.tokens Char.isSpace (#data req);
 
        foreach pkg in pkgs do
                if first then
@@ -132,7 +132,7 @@ elseif $"cmd" = "list" then
                end
        end %>
 </tr>
-<tr> <td align="right" valign="top"><b>Reason</b>:</td> <td colspan="2"><% Web.html (#msg req) %></td> </tr>
+<tr> <td>Reason:</td> <td colspan="2"><% Web.html (#msg req) %></td> </tr>
 </table>
 
 <% if admin then %>
@@ -146,22 +146,22 @@ elseif $"cmd" = "list" then
 elseif $"mod" <> "" then
        Group.requireGroupName "server";
        val id = Web.stoi ($"mod");
-       val req = Apt.lookupRequest id;
+       val req = Apt.lookup id;
        val user = Init.lookupUser (#usr req) %>
-<h3><b>Handle request</b></h3>
+<h3>Handle request</h3>
 
-<form action="apt">
+<form action="apt" method="post">
 <input type="hidden" name="save" value="<% id %>">
-<table>
-<tr> <td align="right"><b>Requestor</b>:</td> <td><a href="user?id=<% #usr req %>"><% #name user %></a></td> </tr>
-<tr> <td align="right"><b>Time</b>:</td> <td><% #stamp req %></td> </tr>
-<tr> <td align="right"><b>Status</b>:</td> <td><select name="status">
+<table class="blanks">
+<tr> <td>Requestor:</td> <td><a href="user?id=<% #usr req %>"><% #name user %></a></td> </tr>
+<tr> <td>Time:</td> <td><% #stamp req %></td> </tr>
+<tr> <td>Status:</td> <td><select name="status">
        <option value="0"<% if #status req = Apt.NEW then %> selected<% end %>>New</option>
        <option value="1"<% if #status req = Apt.INSTALLED then %> selected<% end %>>Installed</option>
        <option value="2"<% if #status req = Apt.REJECTED then %> selected<% end %>>Rejected</option>
 </select></td> </tr>
-<tr> <td align="right" valign="top"><b>Packages</b>:</td> <td><textarea name="pkgs" rows="5" cols="40" wrap="soft"><% Web.html (#pkgs req) %></textarea></td> </tr>
-<tr> <td align="right" valign="top"><b>Message</b>:</td> <td><textarea name="msg" rows="10" cols="80" wrap="soft"><% Web.html (#msg req) %></textarea></td> </tr>
+<tr> <td>Packages:</td> <td><textarea name="pkgs" rows="5" cols="40" wrap="soft"><% Web.html (#data req) %></textarea></td> </tr>
+<tr> <td>Message:</td> <td><textarea name="msg" rows="10" cols="80" wrap="soft"><% Web.html (#msg req) %></textarea></td> </tr>
 <tr> <td><input type="submit" value="Save"></td> </tr>
 </table>
 </form>
@@ -169,43 +169,43 @@ elseif $"mod" <> "" then
 <% elseif $"save" <> "" then
        Group.requireGroupName "server";
        val id = Web.stoi ($"save");
-       val req = Apt.lookupRequest id;
+       val req = Apt.lookup id;
        val oldStatus = #status req;
        val newStatus = Apt.statusFromInt (Web.stoi ($"status"));
-       Apt.modRequest {req with pkgs = $"pkgs", msg = $"msg", status = newStatus};
+       Apt.modify {req with data = $"pkgs", msg = $"msg", status = newStatus};
        if oldStatus <> newStatus then
                if not (Apt.notifyMod (oldStatus, newStatus, Init.getUserName(), id)) then
-                       %><h3><b>Error sending e-mail notification</b></h3><%
+                       %><h3>Error sending e-mail notification</h3><%
                end
        end
-       %><h3><b>Request modified</b></h3>
+       %><h3>Request modified</h3>
        Back to: <a href="apt?cmd=open">open requests</a>, <a href="apt?cmd=list">all requests</a>
 
 <% elseif $"del" <> "" then
        Group.requireGroupName "server";
        val id = Web.stoi ($"del");
-       val req = Apt.lookupRequest id;
+       val req = Apt.lookup id;
        val user = Init.lookupUser (#usr req)
-       %><h3><b>Are you sure you want to delete request by <% #name user %> for <tt><% #pkgs req %></tt>?</b></h3>
+       %><h3>Are you sure you want to delete request by <% #name user %> for <tt><% #data req %></tt>?</h3>
        <a href="apt?del2=<% id %>">Yes, I'm sure!</a>
 
 <% elseif $"del2" <> "" then
        Group.requireGroupName "server";
        val id = Web.stoi ($"del2");
-       Apt.deleteRequest id
-       %><h3><b>Request deleted</b><h3>
+       Apt.delete id
+       %><h3>Request deleted</b><h3>
        Back to: <a href="apt?cmd=open">open requests</a>, <a href="apt?cmd=list">all requests</a>
 
 <% else %>
 
-<h3><b>Request new installations</b></h3>
+<h3>Request new installations</h3>
 
 List the package names you'd like, separated by any whitespace characters.
 
-<form action="apt">
-<table>
-<tr> <td align="right" valign="top"><b>Packages</b>:</td> <td><textarea name="new" rows="10" cols="40" wrap="soft"></textarea></td> </tr>
-<tr> <td align="right" valign="top"><b>Reason</b>:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
+<form action="apt" method="post">
+<table class="blanks">
+<tr> <td>Packages:</td> <td><textarea name="new" rows="10" cols="40" wrap="soft"></textarea></td> </tr>
+<tr> <td>Reason:</td> <td><textarea name="msg" rows="5" cols="80" wrap="soft"></textarea></td> </tr>
 <tr> <td><input type="submit" value="Request"></td> </tr>
 </table>
 </form>