From: Jakub Narebski Date: Tue, 31 Jan 2012 00:20:55 +0000 (+0100) Subject: gitweb: Make project search respect project_filter X-Git-Tag: v1.7.10-rc0~84^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=abc0c9d2d7312c4b153ba1b2b9cd8ba0696f1b04;p=git.git gitweb: Make project search respect project_filter Make gitweb search within filtered projects (i.e. projects shown), and change "List all projects" to "List all projects in '$project_filter/'" if project_filter is used. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c81743b0a..f211594c4 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5161,11 +5161,18 @@ sub git_patchset_body { sub git_project_search_form { my ($searchtext, $search_use_regexp); + my $limit = ''; + if ($project_filter) { + $limit = " in '$project_filter/'"; + } + print "
\n"; print $cgi->startform(-method => 'get', -action => $my_uri) . - $cgi->hidden(-name => 'a', -value => 'project_list') . "\n" . - $cgi->textfield(-name => 's', -value => $searchtext, - -title => 'Search project by name and description', + $cgi->hidden(-name => 'a', -value => 'project_list') . "\n"; + print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n" + if (defined $project_filter); + print $cgi->textfield(-name => 's', -value => $searchtext, + -title => "Search project by name and description$limit", -size => 60) . "\n" . "" . $cgi->checkbox(-name => 'sr', -value => 1, -label => 're', @@ -5173,8 +5180,9 @@ sub git_project_search_form { "\n" . $cgi->submit(-name => 'btnS', -value => 'Search') . $cgi->end_form() . "\n" . - $cgi->a({-href => href(project => undef, searchtext => undef)}, - 'List all projects') . "
\n"; + $cgi->a({-href => href(project => undef, searchtext => undef, + project_filter => $project_filter)}, + esc_html("List all projects$limit")) . "
\n"; print "
\n"; }