]> mj.ucw.cz Git - pciids.git/commitdiff
ID column width is set according to ID type
authorMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 18:47:41 +0000 (20:47 +0200)
committerMichal Vaner <vorner@ucw.cz>
Sun, 31 Aug 2008 18:47:41 +0000 (20:47 +0200)
PciIds/Address/Pci.pm
PciIds/Address/PciClass.pm
PciIds/Address/Toplevel.pm
PciIds/Html/List.pm
static/print.css
static/screen.css

index 40c37f518e4c1fd38136d1ac39f1f5f4b5448348..27e1236ffa573799b028976e5f7ca70784ca7bcf 100644 (file)
@@ -77,4 +77,11 @@ sub subName( $ ) {
        die "Can not happend\n";
 }
 
+sub subIdSize( $ ) {
+       my( $self ) = @_;
+       return 9 if $self->get() =~ /^PC\/....\/..../;
+       return 4 if $self->get() =~ /^PC\/..../;
+       die "Can not happen\n";
+}
+
 1;
index d0c792d4fc766a5a50f92a56e0d48b7a38e2c67d..cb81c34e7a6b93915456b24c0eb2888a78057eae 100644 (file)
@@ -54,4 +54,9 @@ sub subName( $ ) {
        die "Can not happen\n";
 }
 
+sub subIdSize( $ ) {
+       my( $self ) = @_;
+       return 2;
+}
+
 1;
index bc77a64850e43b3034cac956051b32cdfa185bea..2185989faebb6e2da9d336900e6c51b15ec31181 100644 (file)
@@ -91,4 +91,13 @@ sub subName( $ ) {
        }
 }
 
+sub subIdSize( $ ) {
+       my( $self ) = @_;
+       if( $self->get() =~ /^PC/ ) {
+               return 4;
+       } else {
+               return 2;
+       }
+}
+
 1;
index 44ce9773a0cdff1380966684f0402027ce4c79fb..04a52ffb85c305eac89cd38cdfdee61d2d7c1a91 100644 (file)
@@ -23,7 +23,7 @@ sub list( $$$$ ) {
        my( $ok, $parent, $name, $note, $address, $mid ) = loadItem( $tables, $req->uri() );
        return NOT_FOUND unless( $ok );
        my $id = $address->pretty();
-       genHtmlHead( $req, $id, undef );
+       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>';
        genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] );
index 6db1f476c90871b6b665708b4acc0627c5b60b17..0cb1e3805b8c44ea0d269d88a11677d3da0bce04 100644 (file)
@@ -31,10 +31,6 @@ table.subnodes
        width: 100%;
        table-layout: fixed;
 }
-col.id-col
-{
-       width: 3em;
-}
 col.name-col
 {
        width: 60%;
index 15595ef9d0d08e95d79bea15c410fd7df00a34dd..dd67e240be668d1c7b7744a708b7ff61cc09a9b4 100644 (file)
@@ -86,10 +86,6 @@ table.subnodes
        width: 100%;
        table-layout: fixed;
 }
-col.id-col
-{
-       width: 3em;
-}
 col.name-col
 {
        width: 60%;