chiark / gitweb /
wip
[nj-awaymsg.git] / mason / main
index 43ef45a058a29088207fe6563fb2064bdf0e0774..03a01d90615c7725fa88fc775010585e3b905aa6 100755 (executable)
@@ -1,12 +1,10 @@
 <%init>
 use AwayMsg;
 db_connect();
+www_begin($r,$m);
 my ($sth,$row,$sthi,$rowi);
 </%init>
-<html lang="en"><head>
-<title>Email "out of office" setup</title>
-</head><body>
-<h1>Email "out of office" setup</h1>
+<&htmlhead, subpage => 'Overview' &>
 
 <h2>Email addresses and their configuration</h2>
 <%perl>
@@ -24,32 +22,25 @@ $sth->execute();
 <td>Address</td>
 <td>Status</td>
 <td>Which message?</td>
-<td>Expiry date</td>
 </tr><tr>
 % while (my $row= $sth->fetchrow_hashref()) {
 <tr>
 <td><% $row->{'emailaddr'} |h %></td>
 %     if (defined $row->{'textid'}) {
-%         my $expires = expires2timet($row->{'expires'});
-%        if (defined($expires) && $expires < time) {
-<td>expired</td>
-%         } else {
 <td>active</td>
-%         }
 <td><% $row->{'desc'} |h %></td>
-<td><% expirestime2show($expires) |h %></td>
 %     } else {
 <td>inactive</td>
 <td></td>
-<td></td>
 %     }
 </tr>
 % }
 </table>
 
+<hr>
 <h2>Outbound messages</h2>
 <%perl>
-$sth = $dbh->prepare("SELECT * FROM texts ORDER BY desc");
+$sth = $dbh->prepare("SELECT * FROM texts ORDER BY textid");
 $sthi = $dbh->prepare(<<END);
     SELECT * FROM addresses
      WHERE textid = ?
@@ -71,8 +62,9 @@ $sth->execute();
 <% $row->{'text'} |h %>
 </pre>
 
-<input type="submit" name="t<% $row->{'textid'} %>"
+<input type="submit" name="t_<% $row->{'textid'} %>"
    value="Edit or configure this message">
+<hr>
 % }
 <h3>Add new message</h3>
 <input type="submit" name="create"