]> mj.ucw.cz Git - pciids.git/commitdiff
More general titles
authorMichal Vaner <vorner@ucw.cz>
Wed, 3 Sep 2008 09:55:48 +0000 (11:55 +0200)
committerMichal Vaner <vorner@ucw.cz>
Wed, 3 Sep 2008 09:55:48 +0000 (11:55 +0200)
PciIds/Address/Base.pm
PciIds/Html/Changes.pm
PciIds/Html/List.pm
PciIds/Html/Notifications.pm

index ad5f6f874af02012ea523182c92d7b558855e3f1..8b40461dfe3e5921c893176f328bc69e161da249 100644 (file)
@@ -53,4 +53,9 @@ sub addressDeps( $ ) {
        return [];
 }
 
+sub top( $ ) {
+       my( $topAd ) = shift->get() =~ /^([^\/]+)/;
+       return PciIds::Address::new( $topAd );
+}
+
 1;
index 82e49c145b0fc3b0d62e8c52a6fef6897cb4e059..f5fbea1012275f363d85d9f969e5146901dfe506 100644 (file)
@@ -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 "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
        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 "<div class='error'>$error</div>\n" if( defined $error );
        print "<form name='newhistory' id='newhistory' method='POST' action=''>\n<table>";
        genFormEx( [ [ 'textarea', 'Text:', undef, 'text', 'rows="5" cols="50"' ],
index 73815c17e35f8e68d071d9328824f9818214b029..72606a90b1884f2446860ec77802ab6353fb04f9 100644 (file)
@@ -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, "<style type='text/css' media='screen,print'>col.id-col { width: ".$address->subIdSize()*1.25."ex; }</style>\n" );
        print "<div class='top'>\n";
        print '<h1>'.encode( $id ).'</h1>';
index 32cbbed68218a6717ba3c65733dd03c43bf246dc..3807a70c6abe11f1b0ea40370e396028aff4024a 100644 (file)
@@ -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 "<div class='error'>$error</div>\n" if( defined $error );
        my $uri = $addr->get();
        my $notifs = $tables->notificationsUser( $auth->{'authid'} );