]> git.deb.at Git - deb/packages.git/commitdiff
Big CSS cleanup, move all style definitions to CSS files.
authorFrank Lichtenheld <frank@lichtenheld.de>
Tue, 21 Feb 2006 13:19:24 +0000 (13:19 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Tue, 21 Feb 2006 13:19:24 +0000 (13:19 +0000)
Split CSS files in debian.css and packages.css.

lib/Packages/CGI.pm
lib/Packages/DoFilelist.pm
lib/Packages/DoSearch.pm
lib/Packages/DoSearchContents.pm
lib/Packages/DoShow.pm
lib/Packages/HTML.pm
static/debian.css
static/packages.css [new file with mode: 0644]

index cc92e64d6f748c6496c7e0205f7df733a62692a7..e15e510f017edd512b27cb53426825844a524be4 100644 (file)
@@ -35,7 +35,7 @@ sub note {
 }
 sub print_errors {
     return unless @fatal_errors || @errors;
-    print '<div style="margin:.2em;background-color:#F99;font-weight:bold;padding:0.5em;margin:0;">';
+    print '<div class="perror">';
     foreach ((@fatal_errors, @errors)) {
        print "<p>ERROR: $_</p>";
     }
@@ -43,7 +43,7 @@ sub print_errors {
 }
 sub print_debug {
     return unless $debug && @debug;
-    print '<div style="margin:.2em;font-size:80%;border:solid thin grey">';
+    print '<div class="pdebug">';
     print '<h2>Debugging:</h2><pre>';
     foreach (@debug) {
        print "$_\n";
@@ -52,24 +52,26 @@ sub print_debug {
 }
 sub print_hints {
     return unless @hints;
-    print '<div style="margin:.2em;">';
+    print '<div class="phints">';
     foreach (@hints) {
-       print "<p style=\"background-color:#FF9;padding:0.5em;margin:0\">$_</p>";
+       print "<p>$_</p>";
     }
     print '</div>';
 }
 sub print_msgs {
+    print '<div class="pmsgs">';
     foreach (@msgs) {
        print "<p>$_</p>";
     }
+    print '</div>';
 }
 sub print_notes {
     foreach (@notes) {
        my ( $title, $note ) = @$_;
 
-       print '<div style="margin:.2em;border: solid thin black; background-color: #bdf">';
+       print '<div class="pnotes">';
        if ($note) {
-           print "<h2 class=\"pred\">$title</h2>";
+           print "<h2>$title</h2>";
        } else {
            $note = $title;
        }
index dba1d4b74eaf47b71b8fcf1cf740c0fe97f4d874..714171bc9c2213c2faa115ac5adec46be2f8d56d 100644 (file)
@@ -57,12 +57,12 @@ sub do_filelist {
            } else {
                my @files = unpack "L/(CC/a)", $contents{$pkg};
                my $file = "";
-               $$page_content .= '<pre style="border-top:solid #BFC3DC thin;padding:.5em;">';
+               $$page_content .= '<div id="pfilelist"><pre>';
                for (my $i=0; $i<scalar @files;) {
                    $file = substr($file, 0, $files[$i++]).$files[$i++];
                    $$page_content .= "$file\n";
                }
-               $$page_content .= "</pre>";
+               $$page_content .= '</pre></div>';
            }
        } else {
            fatal_error( "Invalid suite/arch combination" );
index 630411f5de9e76db68997d25bd6bce62947c24b1..c90a46f022414013856fa7c4a67f6f38ed19e2b3 100644 (file)
@@ -219,20 +219,21 @@ sub print_packages {
     my ($pkgs, $pkgs_list, $opts, $keyword, $print_func, @func_args) = @_;
 
     #my ($start, $end) = multipageheader( $input, scalar @pkgs, \%opts );
-    my $str .= "<p>Found <em>".(scalar @$pkgs_list)."</em> matching packages.";
+    my $str = '<div id="psearchres">';
+    $str .= "<p>Found <em>".(scalar @$pkgs_list)."</em> matching packages.";
     #my $count = 0;
            
     my $have_exact;
     if (grep { $_ eq $keyword } @$pkgs_list) {
        $have_exact = 1;
-       $str .= '<h2 style="padding:.3em;border-top:solid grey thin;border-bottom:solid grey thin;background-color:#bdf">Exact hits</h2>';
+       $str .= '<h2>Exact hits</h2>';
        $str .= &$print_func( $keyword, $pkgs->{$keyword}||{},
                              map { $_->{$keyword}||{} } @func_args );
        @$pkgs_list = grep { $_ ne $keyword } @$pkgs_list;
     }
            
     if (@$pkgs_list && (($opts->{searchon} ne 'names') || !$opts->{exact})) {
-       $str .= '<h2 style="padding:.3em;border-top:solid grey thin;border-bottom:solid grey thin;background-color:#bdf">Other hits</h2>'
+       $str .= '<h2>Other hits</h2>'
            if $have_exact;
        
        foreach my $pkg (@$pkgs_list) {
@@ -245,6 +246,7 @@ sub print_packages {
        $str .= "<p><a href=\"$SEARCH_URL/FIXME\">".
            ($#{$pkgs_list}+1)."</a> results have not been displayed because you requested only exact matches.</p>";
     }
+    $str .= '</div>';
 
     return $str;
 }
@@ -264,7 +266,7 @@ sub print_package {
                my @versions = version_sort keys %{$pkgs->{$suite}{$archive}};
                my $origin_str = "";
                if ($sect->{$suite}{$archive}{$versions[0]}) {
-                   $origin_str .= " [<span style=\"color:red\">$sect->{$suite}{$archive}{$versions[0]}</span>]";
+                   $origin_str .= " ".marker($sect->{$suite}{$archive}{$versions[0]});
                }
                $str .= sprintf( "<li><a href=\"$ROOT/%s/%s\">%s</a> (%s): %s   %s\n",
                                 $path, $pkg, $path, $subsect->{$suite}{$archive}{$versions[0]},
@@ -273,7 +275,7 @@ sub print_package {
                foreach my $v (@versions) {
                    my $archive_str = "";
                    if ($archives->{$suite}{$archive}{$v}) {
-                       $archive_str .= " [<span style=\"color:red\">$archives->{$suite}{$archive}{$v}</span>]";
+                       $archive_str .= " ".marker($archives->{$suite}{$archive}{$v});
                    }
                    
                    my @archs_to_print = grep { !$archs_printed{$_} } sort keys %{$pkgs->{$suite}{$archive}{$v}};
@@ -309,10 +311,10 @@ sub print_src_package {
            if (exists $pkgs->{$suite}{$archive}) {
                my $origin_str = "";
                if ($sect->{$suite}{$archive}{source}) {
-                   $origin_str .= " [<span style=\"color:red\">$sect->{$suite}{$archive}{source}</span>]";
+                   $origin_str .= " ".marker($sect->{$suite}{$archive}{source});
                }
                if ($archives->{$suite}{$archive}{source}) {
-                   $origin_str .= " [<span style=\"color:red\">$archives->{$suite}{$archive}{source}</span>]";
+                   $origin_str .= " ".marker($archives->{$suite}{$archive}{source});
                }
                $str .= sprintf( "<li><a href=\"$ROOT/%s/source/%s\">%s</a> (%s): %s   %s",
                                 $suite.(($archive ne 'us')?"/$archive":''), $pkg, $suite.(($archive ne 'us')?"/$archive":''), $subsect->{$suite}{$archive}{source},
index a0634fec97750a4602419d53a952adec2947cd61..69d99dc66b3d2ba6d22c32c7d5dfac9e6fa40a62 100644 (file)
@@ -138,7 +138,7 @@ sub do_search_contents {
     $$page_content = '';
     if (@results) {
        $$page_content .= "<p>Found ".scalar(@results)." results</p>";
-       $$page_content .= "<div  id=\"pcontentsres\"><table><colgroup><col><col></colgroup><tr><th style=\"text-align:center\">File</th><th style=\"text-align:center\">Packages</th></tr>";
+       $$page_content .= "<div  id=\"pcontentsres\"><table><colgroup><col><col></colgroup><tr><th>File</th><th>Packages</th></tr>";
        foreach my $result (sort { $a->[0] cmp $b->[0] } @results) {
            my $file = shift @$result;
            $$page_content .= "<tr><td class=\"file\">$file</td><td>";
@@ -150,7 +150,7 @@ sub do_search_contents {
            $$page_content .= join( ", ", map { "<a href=\"$ROOT/$suite/$_\">$_</a>" } sort keys %pkgs);
            $$page_content .= '</td>';
        }
-       $$page_content .= '<tr><th style="text-align:center">File</th><th style="text-align:center">Packages</th></tr>' if @results > 20;
+       $$page_content .= '<tr><th>File</th><th>Packages</th></tr>' if @results > 20;
        $$page_content .= '</table></div>';
     }
 } # sub do_search_contents
index e9bbed81b7f94add75f9b3aa2ee9de6709493b04..1b6979996a639a80477fa069c01c9f9f032e6f67 100644 (file)
@@ -177,7 +177,7 @@ sub do_show {
                        
                        if ($suite eq "experimental") {
                            note( gettext( "Experimental package"),
-                                 gettext( "Warning: This package is from the <span class=\"pred\">experimental</span> distribution. That means it is likely unstable or buggy, and it may even cause data loss. If you ignore this warning and install it nevertheless, you do it on your own risk.")."</p><p>".
+                                 gettext( "Warning: This package is from the <strong>experimental</strong> distribution. That means it is likely unstable or buggy, and it may even cause data loss. If you ignore this warning and install it nevertheless, you do it on your own risk.")."</p><p>".
                                  gettext( "Users of experimental packages are encouraged to contact the package maintainers directly in case of problems." )
                                  );
                        }
@@ -206,7 +206,7 @@ sub do_show {
                            $package_page .= "<div id=\"pdeps\">\n";
                            $package_page .= sprintf( "<h2>".gettext( "Other Packages Related to %s" )."</h2>\n", $pkg );
                            if ($suite eq "experimental") {
-                               note( gettext( "Note that the \"<span class=\"pred\">experimental</span>\" distribution is not self-contained; missing dependencies are likely found in the \"<a href=\"/unstable/\">unstable</a>\" distribution." ) );
+                               note( gettext( "Note that the <strong>experimental</strong> distribution is not self-contained; missing dependencies are likely found in the <a href=\"/unstable/\">unstable</a> distribution." ) );
                            }
                            
                            $package_page .= pdeplegend( [ 'dep',  gettext( 'depends' ) ],
@@ -224,7 +224,7 @@ sub do_show {
                        $package_page .= "<div id=\"pdownload\">";
                        $package_page .= sprintf( "<h2>".gettext( "Download %s\n" )."</h2>",
                                                  $pkg ) ;
-                       $package_page .= "<table border=\"1\" summary=\"".gettext("The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.")."\">\n";
+                       $package_page .= "<table summary=\"".gettext("The download table links to the download of the package and a file overview. In addition it gives information about the package size and the installed size.")."\">\n";
                        $package_page .= "<caption class=\"hidecss\">".gettext("Download for all available architectures")."</caption>\n";
                        $package_page .= "<tr>\n";
                        $package_page .= "<th>".gettext("Architecture")."</th><th>".gettext("Files")."</th><th>".gettext( "Package Size")."</th><th>".gettext("Installed Size")."</th></tr>\n";
@@ -239,9 +239,9 @@ sub do_show {
                            } else {
                                $package_page .= gettext( "no current information" );
                            }
-                           $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                           $package_page .= '</td><td class="size">';
                            $package_page .=  floor(($sizes_deb->{$a}/102.4)+0.5)/10 . "&nbsp;kB";
-                           $package_page .= "</td>\n<td align=right>"; #FIXME: css
+                           $package_page .= '</td><td class="size">';
                            $package_page .=  $sizes_inst->{$a} . "&nbsp;kB";
                            $package_page .= "</td>\n</tr>";
                        }
@@ -377,7 +377,7 @@ sub do_show {
                    my $source_files = $page->get_src( 'files' );
                    my $source_dir = $page->get_src( 'directory' );
                    
-                   $package_page .= sprintf( "<table cellspacing=\"0\" cellpadding=\"2\" summary=\"Download information for the files of this source package\">\n"
+                   $package_page .= sprintf( "<table summary=\"Download information for the files of this source package\">\n"
                                              ."<tr><th>%s</th><th>%s</th><th>%s</th>",
                                              gettext("File"),
                                              gettext("Size (in kB)"),
@@ -400,8 +400,8 @@ sub do_show {
                        $src_url .= "/$source_dir/$src_file_name";
                        
                        $package_page .= "<tr><td><a href=\"$src_url\">$src_file_name</a></td>\n"
-                           ."<td class=\"dotalign\">".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."</td>\n"
-                           ."<td>$src_file_md5</td></tr>";
+                           ."<td>".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."</td>\n"
+                           ."<td class=\"md5sum\">$src_file_md5</td></tr>";
                    }
                    $package_page .= "</table>\n";
                    $package_page .= "</div> <!-- end pdownload -->\n";
index a3b159b556a0e1a5977a186e44f8d6c736adc237..d6d194b5d35e1eaf5d16fc8702b18408a71457d2 100644 (file)
@@ -52,7 +52,7 @@ sub title {
 }
 
 sub marker {
-    return "[<span class=\"pred\">$_[0]</span>]";
+    return "[<strong class=\"pmarker\">$_[0]</strong>]";
 }
 
 sub pdesc {
@@ -69,7 +69,7 @@ sub pdesc {
 }
 
 sub pdeplegend {
-    my $str = "<table border=\"1\" summary=\"legend\"><tr>\n";
+    my $str = "<table id=\"pdeplegend\" summary=\"legend\"><tr>\n";
 
     foreach my $entry (@_) {
        $str .= "<td><img src=\"$ROOT/Pics/$entry->[0].gif\" alt=\"[$entry->[0]]\" width=\"16\" height=\"16\">= $entry->[1]</td>";
@@ -460,6 +460,7 @@ $KEYWORDS_LINE
 $DESC_LINE
 $meta
 <link href="$ROOT/debian.css" rel="stylesheet" type="text/css" media="all">
+<link href="$ROOT/packages.css" rel="stylesheet" type="text/css" media="all">
 </head>
 <body>
 <div id="header">
index c7fa4be4eb12ad0d07d8ea8ceb7d6b04da2022cd..9695645213d36a978a9d102fea9cc1b82532858e 100644 (file)
@@ -164,32 +164,6 @@ blockquote.question p span {
 #cdlogo {
 }
 
-#hpacketsearch {
-       display: block;
-       padding-top: 1px;
-       padding-left: 5px;
-       margin-right: 0.2em;
-       margin-left: auto;
-       text-align: left;
-       width: 25em;
-       top: 0em;
-       right: 0em;
-}
-
-#hpacketsearch p small {
-       color: #990000;
-       font-size: 0.8em;
-       font-weight: normal;
-}
-
-#hpacketsearch p select {
-       font-size: 88%;
-}
-
-#hpacketsearch p input {
-       font-size: 88%;
-}
-
 #navbar {
        /* margin-top: 1em; */
        clear: both;
@@ -445,73 +419,8 @@ div.righthalf {
        margin: 0;
        padding: 0;
 }
-/* classes and div names for package pages */
-
-#pdesc, #pdeps, #pdownload, #pmoreinfo {
-       margin-left: 1em;
-       margin-right: 1em;
-}
-
-#pdesc p {
-       text-align: justify;
-}
-
-.pdescshort {
-       text-align: left;
-       font-size: large;
-       font-weight: bold;
-}
-
-#pdeps table tr td {
-       font-size: 0.9em;
-}
-
-#pdeps ul {
-       list-style-type: none;
-       padding-left: 2em;
-}
-
-#pdeps li {
-       text-indent: -2em;
-}
-
-#pdeps ul.uldep, #pdeps ul.uladep {
-       list-style-type: disc;
-       list-style-image: url(http://packages.debian.org/Pics/dep.gif);
-}
-
-#pdeps ul.ulrec, #pdeps ul.ulidep {
-       list-style-type: disc;
-       list-style-image: url(http://packages.debian.org/Pics/rec.gif);
-}
-
-#pdeps ul.ulsug {
-       list-style-type: disc;
-       list-style-image: url(http://packages.debian.org/Pics/sug.gif);
-}
-
-#pdeps ul.uldep li, #pdeps ul.ulrec li, #pdeps ul.ulsug li, #pdeps ul.uladep li, #pdeps ul.ulidep li {
-       padding-left: 2em;
-}
-#pdeps dl {
-       margin: 0;
-}
-
-#pdownload p, #pdownload form, #pdownload submit {
-       display: inline;
-}
-
-#pdownload td {
-       font-size: 0.85em;
-       text-align: center;
-}
-
-#pmoreinfo p {
-       font-size: 0.85em;
-}
-
 /* colors for packages, warnings and news in ports */
-.pred, .warning, dt.new, .no {
+.warning, dt.new, .no {
        color: red; /* FF0000 */
 }
 
@@ -524,20 +433,13 @@ div.righthalf {
 .psmalltrademark {
        color: green;
 }
-#pdownload table, table.ridgetable, table.reltable {
+table.ridgetable, table.reltable {
        border-width: 4px;
        border-color: gray;
        margin: 0 1em 1em 1em;
        border-style: ridge;
        border-collapse: collapse;
 }
-#pcontentsres table {
-       margin: 0 1em 1em 1em;
-       min-width: 50%;
-       border: 2px gray;
-       border-style: ridge;
-       border-collapse: collapse;
-}
 table.vote {
        margin: 0 auto;
        border-width: 3px;
@@ -551,13 +453,6 @@ table.vote {
        border-style: ridge;
        padding: 0.1em;
 }
-#pcontentsres td.file {
-       font-family: monospace;
-}
-#pcontentsres td {
-/*     font-size: smaller;*/
-       padding: .4em;
-}
 table.reltable th {
        background-color: #44CCCC;
 }
diff --git a/static/packages.css b/static/packages.css
new file mode 100644 (file)
index 0000000..73542cc
--- /dev/null
@@ -0,0 +1,168 @@
+#hpacketsearch {
+       display: block;
+       padding-top: 1px;
+       padding-left: 5px;
+       margin-right: 0.2em;
+       margin-left: auto;
+       text-align: left;
+       width: 25em;
+       top: 0em;
+       right: 0em;
+}
+
+#hpacketsearch p small {
+       color: #990000;
+       font-size: 0.8em;
+       font-weight: normal;
+}
+
+#hpacketsearch p select {
+       font-size: 88%;
+}
+
+#hpacketsearch p input {
+       font-size: 88%;
+}
+
+/* classes and div names for package pages */
+
+#pdesc, #pdeps, #pdownload, #pmoreinfo {
+       margin-left: 1em;
+       margin-right: 1em;
+}
+
+#pdesc p {
+       text-align: justify;
+}
+
+.pdescshort {
+       text-align: left;
+       font-size: large;
+       font-weight: bold;
+}
+
+#pdeps table tr td {
+       font-size: 0.9em;
+}
+
+#pdeps ul {
+       list-style-type: none;
+       padding-left: 2em;
+}
+
+#pdeps li {
+       text-indent: -2em;
+}
+
+#pdeps ul.uldep, #pdeps ul.uladep {
+       list-style-type: disc;
+       list-style-image: url(http://packages.debian.org/Pics/dep.gif);
+}
+
+#pdeps ul.ulrec, #pdeps ul.ulidep {
+       list-style-type: disc;
+       list-style-image: url(http://packages.debian.org/Pics/rec.gif);
+}
+
+#pdeps ul.ulsug {
+       list-style-type: disc;
+       list-style-image: url(http://packages.debian.org/Pics/sug.gif);
+}
+
+#pdeps ul.uldep li, #pdeps ul.ulrec li, #pdeps ul.ulsug li, #pdeps ul.uladep li, #pdeps ul.ulidep li {
+       padding-left: 2em;
+}
+#pdeps dl {
+       margin: 0;
+}
+
+#pdownload p {
+       display: inline;
+}
+
+
+#pmoreinfo p {
+       font-size: 0.85em;
+}
+
+.pmarker {
+       color: red;
+}
+.perror {
+       margin: .2em;
+       background-color: #F99;
+       font-weight: bold;
+       padding: 0.5em;
+       margin: 0;
+}
+.pdebug {
+       margin: .2em;
+       font-size: 80%;
+       border: solid thin gray;
+}
+.phints {
+       background-color: #FF9;
+       padding: 0.5em;
+       margin: 0;
+}
+.pnotes {
+       margin: .2em;
+       border: solid thin black;
+       background-color: #bdf;
+}
+.pnotes h2 {
+       color: red;
+}
+
+table#pdeplegend, #pdownload table {
+       border-width: 4px;
+       border-color: gray;
+       margin: 0 1em 1em 1em;
+       border-style: ridge;
+       border-collapse: collapse;
+}
+
+#pcontentsres table {
+       margin: 0 1em 1em 1em;
+       min-width: 50%;
+       border: 2px gray;
+       border-style: ridge;
+       border-collapse: collapse;
+}
+#pcontentsres col, #pcontentsres th, #pdownload th, #pdownload td,
+       #pdeplegend td {
+       border: 2px #BFC3DC;
+       border-style: ridge;
+       padding: 0.1em;
+}
+#pcontentsres td.file {
+       font-family: monospace;
+}
+#pdownload td {
+       font-size: 0.85em;
+       text-align: center;
+}
+
+#pdownload td.size {
+       text-align: right;
+}
+#pdownload td.md5sum {
+       font-family: monospace;
+}
+#pcontentsres td {
+/*     font-size: smaller;*/
+       padding: .4em;
+}
+#pcontentsres th {
+       text-align: center;
+}
+#psearchres h2 {
+       padding: .3em;
+       border-top: solid gray thin;
+       border-bottom: solid gray thin;
+       background-color: #bdf;
+}
+#pfilelist pre {
+       border-top: solid #BFC3DC thin;
+       padding: .5em;
+}