From: Michal Vaner Date: Wed, 3 Sep 2008 09:55:48 +0000 (+0200) Subject: More general titles X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=9fc9e51f37b97a3c4496d98e476d194d57e7b19f;p=pciids.git More general titles --- diff --git a/PciIds/Address/Base.pm b/PciIds/Address/Base.pm index ad5f6f8..8b40461 100644 --- a/PciIds/Address/Base.pm +++ b/PciIds/Address/Base.pm @@ -53,4 +53,9 @@ sub addressDeps( $ ) { return []; } +sub top( $ ) { + my( $topAd ) = shift->get() =~ /^([^\/]+)/; + return PciIds::Address::new( $topAd ); +} + 1; diff --git a/PciIds/Html/Changes.pm b/PciIds/Html/Changes.pm index 82e49c1..f5fbea1 100644 --- a/PciIds/Html/Changes.pm +++ b/PciIds/Html/Changes.pm @@ -13,9 +13,8 @@ sub genNewItemForm( $$$$$$ ) { my( $req, $args, $auth, $tables, $error, $values ) = @_; my( $ok, $parent, $name, $note, $address ) = loadItem( $tables, $req->uri() ); return NOT_FOUND unless( $ok ); - my $prettyAddr = encode( $address->pretty() ); - genHtmlHead( $req, "$prettyAddr - add new item", undef ); - genCustomHead( $req, $args, $address, "$prettyAddr - add new item", [ $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] ); + genHtmlHead( $req, "Add new item", undef ); + genCustomHead( $req, $args, $address, "Add new item", [ $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] ); print "
$error
\n" if( defined $error ); print "
\n"; genFormEx( [ [ 'input', 'ID:', 'text', 'id', 'maxlength="'.$address->subIdSize().'"' ], @@ -92,9 +91,8 @@ sub genNewHistoryForm( $$$$$$ ) { my( $req, $args, $tables, $auth, $error, $values ) = @_; my( $ok, $parent, $name, $note, $address ) = loadItem( $tables, $req->uri() ); return NOT_FOUND unless( $ok ); - my $prettyAddr = encode( $address->pretty() ); - genHtmlHead( $req, "$prettyAddr - discuss", undef ); - genCustomHead( $req, $args, $address, "$prettyAddr - discuss", [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Help', 'help', 'newhistory' ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] ); + genHtmlHead( $req, "Discuss", undef ); + genCustomHead( $req, $args, $address, "Discuss", [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), [ 'Help', 'help', 'newhistory' ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] ); print "
$error
\n" if( defined $error ); print "\n
"; genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ], diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index 73815c1..72606a9 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -22,7 +22,7 @@ sub list( $$$$ ) { my( $req, $args, $tables, $auth ) = @_; my( $ok, $parent, $name, $note, $address, $mid ) = loadItem( $tables, $req->uri() ); return NOT_FOUND unless( $ok ); - my $id = $address->pretty(); + my $id = $address->top()->pretty(); genHtmlHead( $req, $id, "\n" ); print "
\n"; print '

'.encode( $id ).'

'; diff --git a/PciIds/Html/Notifications.pm b/PciIds/Html/Notifications.pm index 32cbbed..3807a70 100644 --- a/PciIds/Html/Notifications.pm +++ b/PciIds/Html/Notifications.pm @@ -10,8 +10,8 @@ use Apache2::Const qw(:common :http); sub genNotifForm( $$$$$$ ) { my( $req, $args, $tables, $auth, $error, $data ) = @_; my $addr = PciIds::Address::new( $req->uri() ); - genHtmlHead( $req, $addr->pretty().' - notifications', undef ); - genCustomHead( $req, $args, $addr, $addr->pretty()." - notifications", [ $addr->canAddItem() ? [ 'New item', 'newitem' ] : (), $addr->canDiscuss ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'notifications' ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Profile', 'profile' ] ] ); + genHtmlHead( $req, 'Notifications', undef ); + genCustomHead( $req, $args, $addr, "Notifications", [ $addr->canAddItem() ? [ 'New item', 'newitem' ] : (), $addr->canDiscuss ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'notifications' ], [ '', 'jump' ] ], [ logItem( $auth ), [ 'Profile', 'profile' ] ] ); print "
$error
\n" if( defined $error ); my $uri = $addr->get(); my $notifs = $tables->notificationsUser( $auth->{'authid'} );