Index: /trunk/cgi-bin/main.cgi
===================================================================
--- /trunk/cgi-bin/main.cgi	(revision 565)
+++ /trunk/cgi-bin/main.cgi	(revision 566)
@@ -121,10 +121,4 @@
 } # end add new master
 
-elsif($webvar{action} eq 'showmaster') {
-  showMaster();
-}
-elsif($webvar{action} eq 'showrouted') {
-  showRBlock();
-}
 elsif($webvar{action} eq 'listpool') {
   showPool();
@@ -223,43 +217,19 @@
 
 
-# Display detail on master
-# Alrighty then!  We're showing routed blocks within a single master this time.
-# We should be able to steal code from showSummary(), and if I'm really smart
-# I'll figger a way to munge the two together.  (Once I've done that, everything
-# else should follow.  YMMV.)
-sub showMaster {
-
-  $page->param(master => $webvar{block});
-  $page->param(delmaster => ($IPDBacl{$authuser} =~ /d/));
-
-  my $rlist = listMaster($ip_dbh, $webvar{block});
-  $page->param(routedlist => $rlist);
-
-  my $flist = listFree($ip_dbh, $webvar{block});
-  $page->param(unrouted => $flist);
-} # showMaster
-
-
-# Display details of a routed block
-# Alrighty then!  We're showing allocations within a routed block this time.
-# We should be able to steal code from showSummary() and showMaster(), and if
-# I'm really smart I'll figger a way to munge all three together.  (Once I've
-# done that, everything else should follow.  YMMV.
-# This time, we check the database before spewing, because we may
-# not have anything useful to spew.
-sub showRBlock {
-
-  $page->param(master => $webvar{block});
-  $page->param(delrouted => $IPDBacl{$authuser} =~ /d/);
-
-  my $rcity = getRoutedCity($ip_dbh, $webvar{block});
-  $page->param(rcity => $rcity);
-
-  my $blist = listRBlock($ip_dbh, $webvar{block});
-  $page->param(blocklist => $blist);
-
-  my $flist = listFree($ip_dbh, $webvar{block}, 'y');
-  $page->param(unassigned => $flist);
-} # showRBlock
+# Display blocks immediately within a given parent
+sub showSubs {
+  $page->param(block => $webvar{block});
+  $page->param(mayadd => ($IPDBacl{$authuser} =~ /a/));
+  $page->param(maydel => ($IPDBacl{$authuser} =~ /d/));
+
+  my $sublist = listSubs($ip_dbh, block => $webvar{block}, rdepth => $webvar{rdepth});
+  $page->param(deldepth => $webvar{rdepth} - 1);
+  $page->param(rdepth => $webvar{rdepth});
+  $page->param(subdepth => $webvar{rdepth} + 1);
+  $page->param(sublist => $sublist);
+
+  my $flist = listFree($ip_dbh, master => $webvar{block}, rdepth => $webvar{rdepth});
+  $page->param(freelist => $flist);
+} # showSubs
 
 
