Index: branches/htmlform/cgi-bin/main.cgi
===================================================================
--- branches/htmlform/cgi-bin/main.cgi	(revision 475)
+++ branches/htmlform/cgi-bin/main.cgi	(revision 476)
@@ -1102,18 +1102,22 @@
 mailNotify($ip_dbh, 's:swi', "SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
 	"$webvar{block} had SWIP status changed to \"Yes\" by $authuser") if $webvar{swip} eq 'on';
-  open (HTML, "../updated.html")
-	or croak "Could not open updated.html :$!";
-  my $html = join('', <HTML>);
+
+## node hack
+  if ($webvar{node} && $webvar{node} ne '-') {
+    $sth = $ip_dbh->prepare("SELECT node_name FROM nodes WHERE node_id=?");
+    $sth->execute($webvar{node});
+    my ($nodename) = $sth->fetchrow_array();
+    $page->param(nodename => $nodename);
+  }
+## end node hack
 
   # Link back to browse-routed or list-pool page on "Update complete" page.
-  my $backlink = "/ip/cgi-bin/main.cgi?action=";
   my $cblock;	# to contain the CIDR of the container block we're retrieving.
   my $sql;
   if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) {
+    $page->param(backpool => 1);
     $sql = "select pool from poolips where ip='$webvar{block}'";
-    $backlink .= "listpool&pool=";
   } else {
     $sql = "select cidr from routed where cidr >>= '$webvar{block}'";
-    $backlink .= "showrouted&block=";
   }
   # I define there to be no errors on this operation...  so we don't need to check for them.
@@ -1123,30 +1127,17 @@
   $sth->fetch();
   $sth->finish;
-  $backlink .= $cblock;
-
-my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No');
-  $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g;
-  $webvar{city} = $q->escapeHTML($webvar{city});
-  $html =~ s/\$\$CITY\$\$/$webvar{city}/g;
-  $html =~ s/\$\$ALLOCTYPE\$\$/$webvar{alloctype}/g;
-  $html =~ s/\$\$TYPEFULL\$\$/$disp_alloctypes{$webvar{alloctype}}/g;
-  $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g;
-  $html =~ s/\$\$SWIP\$\$/$swiptmp/g;
-  $webvar{circid} = $q->escapeHTML($webvar{circid});
-  $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g;
-  $webvar{desc} = $q->escapeHTML($webvar{desc});
-  $html =~ s/\$\$DESC\$\$/$webvar{desc}/g;
-  $webvar{notes} = $q->escapeHTML($webvar{notes});
-  $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g;
-  $html =~ s/\$\$BACKLINK\$\$/$backlink/g;
-  $html =~ s/\$\$BACKBLOCK\$\$/$cblock/g;
-
-  if ($IPDBacl{$authuser} =~ /s/) {
-    $privdata = qq(<tr class="color2"><td valign="top">Restricted data:</td>).
-	qq(<td class="regular">).$q->escapeHTML($webvar{privdata}).qq(</td></tr>\n);
-  }
-  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
-
-  print $html;
+  $page->param(backblock => $cblock);
+
+  $page->param(cidr => $webvar{block});
+  $page->param(city => $webvar{city});
+  $page->param(disptype => $disp_alloctypes{$webvar{alloctype}});
+  $page->param(custid => $webvar{custid});
+  $page->param(swip => $webvar{swip} eq 'on' ? 'Yes' : 'No');
+  $page->param(circid => $q->escapeHTML($webvar{circid}));
+  $page->param(desc => $q->escapeHTML($webvar{desc}));
+  $page->param(notes => $q->escapeHTML($webvar{notes}));
+  $webvar{privdata} = ($webvar{privdata} ? $q->escapeHTML($webvar{privdata}) : "&nbsp;");
+  $page->param(privdata => $webvar{privdata})
+	if $IPDBacl{$authuser} =~ /s/;
 
 } # update()
@@ -1241,5 +1232,5 @@
 sub finalDelete {
   if ($IPDBacl{$authuser} !~ /d/) {
-    printError("You shouldn't have been able to get here.  Access denied.");
+    $page->param(aclerr => 1);
     return;
   }
@@ -1250,6 +1241,6 @@
   my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{alloctype});
 
+  $page->param(block => $webvar{block});
   if ($code eq 'OK') {
-    print "<div class=heading align=center>Success!  $webvar{block} deallocated.</div>\n";
     syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block}".
 	" $custid, $city, desc='$description'";
@@ -1258,10 +1249,10 @@
 	"CustID: $custid\nCity: $city\nDescription: $description\n");
   } else {
+    $page->param(failmsg => $msg);
     if ($webvar{alloctype} =~ /^.i$/) {
       syslog "err", "$authuser could not deallocate static IP '$webvar{block}': '$msg'";
-      printError("Could not deallocate static IP $webvar{block}: $msg");
     } else {
       syslog "err", "$authuser could not deallocate netblock '$webvar{block}': '$msg'";
-      printError("Could not deallocate netblock $webvar{block}: $msg");
+      $page->param(netblock => 1);
     }
   }
Index: branches/htmlform/templates/edit.tmpl
===================================================================
--- branches/htmlform/templates/edit.tmpl	(revision 475)
+++ branches/htmlform/templates/edit.tmpl	(revision 476)
@@ -51,5 +51,5 @@
 <TMPL_IF typesupportsnodes>
 <TMPL_IF maychange>
-<select name=demarc><TMPL_UNLESS havenodeid>
+<select name="node"><TMPL_UNLESS havenodeid>
 	<option selected="selected">--</option></TMPL_UNLESS>
 <TMPL_LOOP NAME=nodelist>
Index: branches/htmlform/templates/finaldelete.tmpl
===================================================================
--- branches/htmlform/templates/finaldelete.tmpl	(revision 476)
+++ branches/htmlform/templates/finaldelete.tmpl	(revision 476)
@@ -0,0 +1,14 @@
+<div class="center">
+<TMPL_IF aclerr>
+<p>You shouldn't have been able to get here.  Access denied.</p>
+<input type="button" value="Back" onclick="history.go(-1)">
+<TMPL_ELSE>
+<TMPL_IF failmsg>
+<p>Could not deallocate <TMPL_IF netblock>netblock<TMPL_ELSE>static IP</TMPL_IF> <TMPL_VAR NAME=block>: <TMPL_VAR NAME=failmsg></p>
+<input type="button" value="Back" onclick="history.go(-1)">
+<TMPL_ELSE>
+<div class="heading">Success!  <TMPL_VAR NAME=block> deallocated.</div>
+</TMPL_IF>
+</TMPL_IF>
+</div>
+
Index: branches/htmlform/templates/update.tmpl
===================================================================
--- branches/htmlform/templates/update.tmpl	(revision 475)
+++ branches/htmlform/templates/update.tmpl	(revision 476)
@@ -19,24 +19,29 @@
 
 <tr class="row1">
+<td>Demarc/tower:</td>
+<td><TMPL_IF nodename><TMPL_VAR NAME=nodename><TMPL_ELSE>N/A</TMPL_IF></td>
+</tr>
+
+<tr class="row0">
 <td>Customer ID:</td>
 <td><TMPL_VAR NAME=custid></td>
 </tr>
 
-<tr class="row0">
+<tr class="row1">
 <td>SWIPed?:</td>
 <td><TMPL_VAR NAME=swip></td>
 </tr>
 
-<tr class="row1">
+<tr class="row0">
 <td>Circuit ID:</td>
 <td><TMPL_VAR NAME=circid></td>
 </tr>
 
-<tr class="row0">
+<tr class="row1">
 <td valign="top">Description/Name:</td>
 <td><TMPL_VAR NAME=desc></td>
 </tr>
 
-<tr class="row1">
+<tr class="row0">
 <td valign="top">Notes:</td>
 <td><TMPL_VAR NAME=notes></td>
@@ -44,15 +49,14 @@
 
 <TMPL_IF privdata>
-<tr class="color1">
+<tr class="row1">
 <td valign="top">Restricted data:</td>
-<td><TMPL_VAR NAME=privdata>
-</td>
+<td><TMPL_VAR NAME=privdata></td>
 </tr>
 </TMPL_IF>
 
 </table>
-<p>
-<div name="backlink">
-<a href="$$BACKLINK$$">Back to $$BACKBLOCK$$</a>
+
+<br>
+<div class="backlink">
+<a href="/ip/cgi-bin/main.cgi?action=<TMPL_IF backpool>listpool&amp;pool=<TMPL_ELSE>showrouted&amp;block=</TMPL_IF><TMPL_VAR NAME=backblock>">Back to <TMPL_VAR NAME=backblock></a>
 </div>
-</p>
