From e6b3185dca153c2799f31f9931d0f951284a3fc9 Mon Sep 17 00:00:00 2001 From: ijackson Date: Wed, 8 Sep 1999 17:48:20 +0000 Subject: [PATCH] Show overlapping entries all the time, nicely. --- bcp5-registry.pl | 3 ++- listdb.pl | 22 ++++++++++++++++++---- template.html | 37 ++++++++++++++++++++++++++++--------- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/bcp5-registry.pl b/bcp5-registry.pl index ab1e3f5..e20ee79 100755 --- a/bcp5-registry.pl +++ b/bcp5-registry.pl @@ -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 () { diff --git a/listdb.pl b/listdb.pl index de389fe..677d11d 100644 --- 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'}; diff --git a/template.html b/template.html index 406ed2d..1106e1a 100644 --- a/template.html +++ b/template.html @@ -483,7 +483,7 @@ Entire database @@@endif:@@@ -@@@if:listingall|listingarea|listingoverlap@@@ +@@@if:listingall|listingarea|listingoverlap|listingviewoverlap@@@

Database

@@ -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 emphasized below. -Any existing registrations that overlap with it are also emphasized, -and marked with an asterisk *. +Any existing registrations that overlap with it are also +emphasized, and marked with an asterisk *. +@@@endif:@@@ + +@@@if:listingviewoverlap@@@ +This registration is +emphasized, and marked with an asterisk *. @@@endif:@@@

@@@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:@@@
Range Name Contact Email @@ -526,19 +540,24 @@ range; this can also be used to modify it.
-@@@if:db_pickoverlap@@@ +@@@if:db_pickedoverlap|db_viewing@@@ @@@endif:@@@ +@@@if:db_viewing@@@ +@@@db_net@@@ +@@@endif:@@@ +@@@ifnot:db_viewing@@@ @@@db_net@@@ -@@@if:db_pickoverlap@@@ +@@@endif:@@@ +@@@if:db_pickedoverlap|db_viewing@@@ * @@@endif:@@@ -@@@if:db_pickoverlap@@@ +@@@if:db_pickedoverlap|db_viewing@@@ @@@db_name@@@ @@@endif:@@@ -@@@ifnot:db_pickoverlap@@@ +@@@ifnot:db_pickedoverlap|db_viewing@@@ @@@db_name@@@ @@@endif:@@@ -- 2.30.2