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 <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a1e1b2d77b
commit
abc0c9d2d7
@ -5161,11 +5161,18 @@ sub git_patchset_body {
|
|||||||
sub git_project_search_form {
|
sub git_project_search_form {
|
||||||
my ($searchtext, $search_use_regexp);
|
my ($searchtext, $search_use_regexp);
|
||||||
|
|
||||||
|
my $limit = '';
|
||||||
|
if ($project_filter) {
|
||||||
|
$limit = " in '$project_filter/'";
|
||||||
|
}
|
||||||
|
|
||||||
print "<div class=\"projsearch\">\n";
|
print "<div class=\"projsearch\">\n";
|
||||||
print $cgi->startform(-method => 'get', -action => $my_uri) .
|
print $cgi->startform(-method => 'get', -action => $my_uri) .
|
||||||
$cgi->hidden(-name => 'a', -value => 'project_list') . "\n" .
|
$cgi->hidden(-name => 'a', -value => 'project_list') . "\n";
|
||||||
$cgi->textfield(-name => 's', -value => $searchtext,
|
print $cgi->hidden(-name => 'pf', -value => $project_filter). "\n"
|
||||||
-title => 'Search project by name and description',
|
if (defined $project_filter);
|
||||||
|
print $cgi->textfield(-name => 's', -value => $searchtext,
|
||||||
|
-title => "Search project by name and description$limit",
|
||||||
-size => 60) . "\n" .
|
-size => 60) . "\n" .
|
||||||
"<span title=\"Extended regular expression\">" .
|
"<span title=\"Extended regular expression\">" .
|
||||||
$cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
|
$cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
|
||||||
@ -5173,8 +5180,9 @@ sub git_project_search_form {
|
|||||||
"</span>\n" .
|
"</span>\n" .
|
||||||
$cgi->submit(-name => 'btnS', -value => 'Search') .
|
$cgi->submit(-name => 'btnS', -value => 'Search') .
|
||||||
$cgi->end_form() . "\n" .
|
$cgi->end_form() . "\n" .
|
||||||
$cgi->a({-href => href(project => undef, searchtext => undef)},
|
$cgi->a({-href => href(project => undef, searchtext => undef,
|
||||||
'List all projects') . "<br />\n";
|
project_filter => $project_filter)},
|
||||||
|
esc_html("List all projects$limit")) . "<br />\n";
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user