From: Frank Lichtenheld Date: Tue, 21 Feb 2006 13:19:24 +0000 (+0000) Subject: Big CSS cleanup, move all style definitions to CSS files. X-Git-Tag: switch-to-templates~92 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=e6999b858367d9d83e0fa2c32cddfd31b4416486;p=deb%2Fpackages.git Big CSS cleanup, move all style definitions to CSS files. Split CSS files in debian.css and packages.css. --- diff --git a/lib/Packages/CGI.pm b/lib/Packages/CGI.pm index cc92e64..e15e510 100644 --- a/lib/Packages/CGI.pm +++ b/lib/Packages/CGI.pm @@ -35,7 +35,7 @@ sub note { } sub print_errors { return unless @fatal_errors || @errors; - print '
'; + print '
'; foreach ((@fatal_errors, @errors)) { print "

ERROR: $_

"; } @@ -43,7 +43,7 @@ sub print_errors { } sub print_debug { return unless $debug && @debug; - print '
'; + print '
'; print '

Debugging:

';
     foreach (@debug) {
 	print "$_\n";
@@ -52,24 +52,26 @@ sub print_debug {
 }
 sub print_hints {
     return unless @hints;
-    print '
'; + print '
'; foreach (@hints) { - print "

$_

"; + print "

$_

"; } print '
'; } sub print_msgs { + print '
'; foreach (@msgs) { print "

$_

"; } + print '
'; } sub print_notes { foreach (@notes) { my ( $title, $note ) = @$_; - print '
'; + print '
'; if ($note) { - print "

$title

"; + print "

$title

"; } else { $note = $title; } diff --git a/lib/Packages/DoFilelist.pm b/lib/Packages/DoFilelist.pm index dba1d4b..714171b 100644 --- a/lib/Packages/DoFilelist.pm +++ b/lib/Packages/DoFilelist.pm @@ -57,12 +57,12 @@ sub do_filelist { } else { my @files = unpack "L/(CC/a)", $contents{$pkg}; my $file = ""; - $$page_content .= '
';
+		$$page_content .= '
';
 		for (my $i=0; $i matching packages.";
+    my $str = '
'; + $str .= "

Found ".(scalar @$pkgs_list)." matching packages."; #my $count = 0; my $have_exact; if (grep { $_ eq $keyword } @$pkgs_list) { $have_exact = 1; - $str .= '

Exact hits

'; + $str .= '

Exact hits

'; $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 .= '

Other hits

' + $str .= '

Other hits

' if $have_exact; foreach my $pkg (@$pkgs_list) { @@ -245,6 +246,7 @@ sub print_packages { $str .= "

". ($#{$pkgs_list}+1)." results have not been displayed because you requested only exact matches.

"; } + $str .= '
'; 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 .= " [$sect->{$suite}{$archive}{$versions[0]}]"; + $origin_str .= " ".marker($sect->{$suite}{$archive}{$versions[0]}); } $str .= sprintf( "
  • %s (%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 .= " [$archives->{$suite}{$archive}{$v}]"; + $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 .= " [$sect->{$suite}{$archive}{source}]"; + $origin_str .= " ".marker($sect->{$suite}{$archive}{source}); } if ($archives->{$suite}{$archive}{source}) { - $origin_str .= " [$archives->{$suite}{$archive}{source}]"; + $origin_str .= " ".marker($archives->{$suite}{$archive}{source}); } $str .= sprintf( "
  • %s (%s): %s %s", $suite.(($archive ne 'us')?"/$archive":''), $pkg, $suite.(($archive ne 'us')?"/$archive":''), $subsect->{$suite}{$archive}{source}, diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index a0634fe..69d99dc 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -138,7 +138,7 @@ sub do_search_contents { $$page_content = ''; if (@results) { $$page_content .= "

    Found ".scalar(@results)." results

    "; - $$page_content .= "
    "; + $$page_content .= "
    FilePackages
    "; foreach my $result (sort { $a->[0] cmp $b->[0] } @results) { my $file = shift @$result; $$page_content .= "'; } - $$page_content .= '' if @results > 20; + $$page_content .= '' if @results > 20; $$page_content .= '
    FilePackages
    $file"; @@ -150,7 +150,7 @@ sub do_search_contents { $$page_content .= join( ", ", map { "$_" } sort keys %pkgs); $$page_content .= '
    FilePackages
    FilePackages
    '; } } # sub do_search_contents diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index e9bbed8..1b69799 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -177,7 +177,7 @@ sub do_show { if ($suite eq "experimental") { note( gettext( "Experimental package"), - gettext( "Warning: This package is from the experimental 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.")."

    ". + gettext( "Warning: This package is from the experimental 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.")."

    ". 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 .= "

    \n"; $package_page .= sprintf( "

    ".gettext( "Other Packages Related to %s" )."

    \n", $pkg ); if ($suite eq "experimental") { - note( gettext( "Note that the \"experimental\" distribution is not self-contained; missing dependencies are likely found in the \"unstable\" distribution." ) ); + note( gettext( "Note that the experimental distribution is not self-contained; missing dependencies are likely found in the unstable distribution." ) ); } $package_page .= pdeplegend( [ 'dep', gettext( 'depends' ) ], @@ -224,7 +224,7 @@ sub do_show { $package_page .= "
    "; $package_page .= sprintf( "

    ".gettext( "Download %s\n" )."

    ", $pkg ) ; - $package_page .= "\n"; + $package_page .= "
    \n"; $package_page .= "\n"; $package_page .= "\n"; $package_page .= "\n"; @@ -239,9 +239,9 @@ sub do_show { } else { $package_page .= gettext( "no current information" ); } - $package_page .= "\n\n\n"; } @@ -377,7 +377,7 @@ sub do_show { my $source_files = $page->get_src( 'files' ); my $source_dir = $page->get_src( 'directory' ); - $package_page .= sprintf( "
    ".gettext("Download for all available architectures")."
    ".gettext("Architecture")."".gettext("Files")."".gettext( "Package Size")."".gettext("Installed Size")."
    "; #FIXME: css + $package_page .= ''; $package_page .= floor(($sizes_deb->{$a}/102.4)+0.5)/10 . " kB"; - $package_page .= ""; #FIXME: css + $package_page .= ''; $package_page .= $sizes_inst->{$a} . " kB"; $package_page .= "
    \n" + $package_page .= sprintf( "
    \n" ."", gettext("File"), gettext("Size (in kB)"), @@ -400,8 +400,8 @@ sub do_show { $src_url .= "/$source_dir/$src_file_name"; $package_page .= "\n" - ."\n" - .""; + ."\n" + .""; } $package_page .= "
    %s%s%s
    $src_file_name".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."$src_file_md5
    ".sprintf("%.1f", (floor(($src_file_size/102.4)+0.5)/10))."$src_file_md5
    \n"; $package_page .= "
    \n"; diff --git a/lib/Packages/HTML.pm b/lib/Packages/HTML.pm index a3b159b..d6d194b 100644 --- a/lib/Packages/HTML.pm +++ b/lib/Packages/HTML.pm @@ -52,7 +52,7 @@ sub title { } sub marker { - return "[$_[0]]"; + return "[$_[0]]"; } sub pdesc { @@ -69,7 +69,7 @@ sub pdesc { } sub pdeplegend { - my $str = "\n"; + my $str = "
    \n"; foreach my $entry (@_) { $str .= ""; @@ -460,6 +460,7 @@ $KEYWORDS_LINE $DESC_LINE $meta +
    [0].gif\" alt=\"[$entry->[0]]\" width=\"16\" height=\"16\">= $entry->[1]