]> mj.ucw.cz Git - pciids.git/commitdiff
Link back to main page
authorMichal Vaner <vorner@ucw.cz>
Tue, 19 Aug 2008 09:03:53 +0000 (11:03 +0200)
committerMichal Vaner <vorner@ucw.cz>
Tue, 19 Aug 2008 09:03:53 +0000 (11:03 +0200)
When browsing vendor lists (toplevel in each tree), have a link to the
main page.

PciIds/Html/List.pm

index aaa71700ab6e9f4a2f3197b9b9e0e45a0b4659bc..4e1cdc60a64f15aad4258beadacd535e140e2458 100644 (file)
@@ -28,7 +28,11 @@ sub list( $$$$ ) {
        genMenu( $address, $args, $auth );
        print htmlDiv( 'name', '<p>'.encode( $name ) ) if( defined( $name ) );
        print htmlDiv( 'description', '<p>'.encode( $description ) ) if( defined( $description ) );
-       print '<p><a class="navigation" href="/read/'.$address->parent()->get().'/">'.encode( $address->parent()->pretty() )."</a>" if( defined( $address->parent() ) );
+       if( defined( $address->parent() ) ) {
+               print '<p><a class="navigation" href="/read/'.$address->parent()->get().'/">'.encode( $address->parent()->pretty() )."</a>";
+       } else {
+               print '<p><a class="navigation" href="/index.html">Main page</a>';
+       }
        my $diss = 0;
        my $comment;
        foreach $comment ( @{$tables->history( $address->get() )} ) {