From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: "Bernhard R. Link" <brl+git@mail.brlink.eu>,
Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 2/2] gitweb: Make project search respect project_filter
Date: Tue, 31 Jan 2012 01:20:55 +0100 [thread overview]
Message-ID: <1327969255-26622-3-git-send-email-jnareb@gmail.com> (raw)
In-Reply-To: <1327969255-26622-1-git-send-email-jnareb@gmail.com>
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>
---
This patch is new.
gitweb/gitweb.perl | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index c4e0d8e..80975dd 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5158,11 +5158,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 "<div class=\"projsearch\">\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" .
"<span title=\"Extended regular expression\">" .
$cgi->checkbox(-name => 'sr', -value => 1, -label => 're',
@@ -5170,8 +5177,9 @@ sub git_project_search_form {
"</span>\n" .
$cgi->submit(-name => 'btnS', -value => 'Search') .
$cgi->end_form() . "\n" .
- $cgi->a({-href => href(project => undef, searchtext => undef)},
- 'List all projects') . "<br />\n";
+ $cgi->a({-href => href(project => undef, searchtext => undef,
+ project_filter => $project_filter)},
+ esc_html("List all projects$limit")) . "<br />\n";
print "</div>\n";
}
--
1.7.6
prev parent reply other threads:[~2012-01-31 0:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 0:20 [PATCH 0/2] gitweb: Project search improvements Jakub Narebski
2012-01-31 0:20 ` [PATCH 1/2] gitweb: Improve projects search form Jakub Narebski
2012-01-31 0:20 ` Jakub Narebski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327969255-26622-3-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=brl+git@mail.brlink.eu \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).