From c68e5b88632e3a9fc0c5994960a22c96d5cdf047 Mon Sep 17 00:00:00 2001
From: Jeroen van Wolffelaar
Date: Fri, 3 Mar 2006 02:29:25 +0000
Subject: [PATCH] Hilight the keyword in contents searches
---
lib/Packages/DoSearchContents.pm | 10 ++++++----
static/packages.css | 3 +++
2 files changed, 9 insertions(+), 4 deletions(-)
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 .= ''._g('File').' | '._g('Packages')
- .' |
';
+ ."\n";
foreach my $file (sort keys %results) {
- $$page_content .= "/$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 .= ' | ';
+ $$page_content .= "
\n";
}
- $$page_content .= ''._g('File').' | '._g('Packages').' |
' if @results > 20;
+ $$page_content .= ''._g('File').' | '._g('Packages')." |
\n" if @results > 20;
$$page_content .= '
';
}
} # 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;
+}
--
2.39.2