chiark / gitweb /
Show overlapping entries all the time, nicely.
authorijackson <ijackson>
Wed, 8 Sep 1999 17:48:20 +0000 (17:48 +0000)
committerijackson <ijackson>
Wed, 8 Sep 1999 17:48:20 +0000 (17:48 +0000)
bcp5-registry.pl
listdb.pl
template.html

index ab1e3f5eefe0de7d11d6878ef10c74fa599218b0..e20ee79e22dc0ee236274a5cf730c7e955cd0926 100755 (executable)
@@ -122,6 +122,7 @@ $justcreated= 0;
 $justupdated= 0;
 $picked= 0;
 $listingall= 0;
+$listingviewoverlap= 0;
 $passwordsent= 0;
 $list= 0;
 $notfound= 0;
@@ -341,7 +342,7 @@ sub show_entry () {
     }
     $net= display_net($network,$prefix);
     $emailhidechecked= $ent->{'hiddenemail'} ? 'checked' : '';
-    $listoverlap= $net;
+    list_database('viewoverlap');
 }
 
 sub set_entry () {
index de389fe464b57d40af8a588147fa309510bb3081..677d11d12c570490c3dcba52aacfbd39d3d01ee0 100644 (file)
--- a/listdb.pl
+++ b/listdb.pl
@@ -20,7 +20,7 @@ sub list_database ($) {
     my ($instyle) = @_;
     my ($t, $v, $k, $x);
 print DEBUG "ldb 0 $instyle\n";
-    $instyle =~ m/all|area|overlap/ or die "$instyle ?";
+    $instyle =~ m/^all|area|viewoverlap|overlap/ or die "$instyle ?";
     $listing= $&;
     &{"dblist_prep_$listing"}();
     @kl= ();
@@ -68,6 +68,12 @@ sub dblist_cond_overlap {
     return net_overlap($dblt_network,$dblt_prefix, $dblo_network,$dblo_prefix);
 }
 
+sub dblist_prep_viewoverlap {
+    ($dblo_network,$dblo_prefix) = ($network,$prefix);
+    $listoverlap= display_net($network,$prefix);
+}
+sub dblist_cond_viewoverlap { dblist_cond_overlap(); }
+
 sub foreach_start_db { $db_i=0; }
 sub foreach_cond_db { return $db_i < @kl; }
 sub foreach_incr_db { $db_i++; }
@@ -84,9 +90,17 @@ sub foreach_setvars_db {
        $db_id= $k;
     }
     $db_net= display_net($dblt_network,$dblt_prefix);
-    $db_pickoverlap= (exists $db{'picked'} &&
-                     net_overlap($dblt_network, $dblt_prefix,
-                                 $pick_network, $pick_prefix)) ? 1 : 0;
+    if (exists $db{'picked'}) {
+       $db_pickedoverlap= net_overlap($dblt_network, $dblt_prefix,
+                                      $pick_network, $pick_prefix);
+    } else {
+       $db_pickedoverlap= 0;
+    }
+    if (defined $id) {
+       $db_viewing= ($k eq $id);
+    } else {
+       $db_viewing= 0;
+    }
     $db_name= html_sani($ent->{'name'});
     $db_contact= html_sani($ent->{'contact'});
     $db_hiddenemail= $ent->{'hiddenemail'};
index 406ed2d2f526b1e9d675dcef5b7fb38e2fb6709f..1106e1ad7eaea246b97e11c3e53bd044b4cd8134 100644 (file)
@@ -483,7 +483,7 @@ Entire database
 
 @@@endif:@@@
 
-@@@if:listingall|listingarea|listingoverlap@@@
+@@@if:listingall|listingarea|listingoverlap|listingviewoverlap@@@
 
 <h2>Database</h2>
 
@@ -494,6 +494,9 @@ Entire database
 @@@if:listingoverlap@@@
 Entries which overlap with @@@listoverlap@@@
 @@@endif:@@@
+@@@if:listingviewoverlap@@@
+Entries which overlap with this one
+@@@endif:@@@
 @@@if:listingarea@@@
 Database for entries allocated from @@@listarea@@@
 @@@endif:@@@
@@ -501,15 +504,26 @@ Database for entries allocated from @@@listarea@@@
 
 @@@if:picked@@@
 The range picked for you has been <strong>emphasized</strong> below.
-Any existing registrations that overlap with it are also emphasized,
-and marked with an asterisk <strong>*</strong>.
+Any existing registrations that overlap with it are also
+emphasized, and marked with an asterisk <strong>*</strong>.
+@@@endif:@@@
+
+@@@if:listingviewoverlap@@@
+This registration is
+emphasized, and marked with an asterisk <strong>*</strong>.
 @@@endif:@@@
 <p>
 
 @@@ifnot:listingnonefound@@@
 
-You can get details about an existing entry by clicking on its address
-range; this can also be used to modify it.
+@@@if:listingviewoverlap@@@
+You can get details about another, overlapping entry by selecting it
+from this list; this can also be used to modify the other entry.
+@@@endif:@@@
+@@@ifnot:listingviewoverlap@@@
+You can get details about an existing entry by selecting it
+from this list; this can also be used to modify it.
+@@@endif:@@@
 
 <table>
 <tr><td>Range <td>Name <td>Contact <td>Email
@@ -526,19 +540,24 @@ range; this can also be used to modify it.
 
 <tr>
 <td>
-@@@if:db_pickoverlap@@@
+@@@if:db_pickedoverlap|db_viewing@@@
 <strong>
 @@@endif:@@@
+@@@if:db_viewing@@@
+@@@db_net@@@
+@@@endif:@@@
+@@@ifnot:db_viewing@@@
 <A href="@@@cgi@@@?id=@@@db_id@@@">@@@db_net@@@</A>
-@@@if:db_pickoverlap@@@
+@@@endif:@@@
+@@@if:db_pickedoverlap|db_viewing@@@
 *</strong>
 @@@endif:@@@
 
 <td>
-@@@if:db_pickoverlap@@@
+@@@if:db_pickedoverlap|db_viewing@@@
 <strong>@@@db_name@@@</strong>
 @@@endif:@@@
-@@@ifnot:db_pickoverlap@@@
+@@@ifnot:db_pickedoverlap|db_viewing@@@
 @@@db_name@@@
 @@@endif:@@@