From: Jeroen van Wolffelaar Date: Fri, 3 Mar 2006 02:29:25 +0000 (+0000) Subject: Hilight the keyword in contents searches X-Git-Tag: switch-to-templates~16 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=c68e5b88632e3a9fc0c5994960a22c96d5cdf047;p=deb%2Fpackages.git Hilight the keyword in contents searches --- diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index b303525..bf0b435 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -190,9 +190,11 @@ sub do_search_contents { scalar keys %results )."

"; $$page_content .= '
'; + ."\n"; foreach my $file (sort keys %results) { - $$page_content .= "'; + $$page_content .= "\n"; } - $$page_content .= '' if @results > 20; + $$page_content .= '\n" if @results > 20; $$page_content .= '
'._g('File').''._g('Packages') - .'
/$file"; + my $file_enc = encode_entities($file); + $file_enc =~ s#(\Q$keyword_enc\E)#$1#g; + $$page_content .= "
/$file_enc"; my @pkgs; foreach my $pkg (sort keys %{$results{$file}}) { my $arch_str = ''; @@ -209,9 +211,9 @@ sub do_search_contents { push @pkgs, "$suite})."\">$pkg$arch_str"; } $$page_content .= join( ", ", @pkgs); - $$page_content .= '
'._g('File').''._g('Packages').'
'._g('File').''._g('Packages')."
'; } } # sub do_search_contents diff --git a/static/packages.css b/static/packages.css index 73542cc..017ab8f 100644 --- a/static/packages.css +++ b/static/packages.css @@ -166,3 +166,6 @@ table#pdeplegend, #pdownload table { border-top: solid #BFC3DC thin; padding: .5em; } +.keyword { + background-color: #bdf; +}