From 4fcf1c5ac62c67821457e3305107e839005d9789 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sun, 5 Apr 2015 17:23:05 -0700 Subject: [PATCH] gitweb: correct 'browse all projects' link The 'browse all projects' link should not show on the project list page if that's separate from the front page. Signed-off-by: Kyle J. McKay --- gitweb/gitweb.perl | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index f849271f03..f0d78a6f92 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5541,10 +5541,7 @@ sub git_project_search_form { -checked => $search_use_regexp) . "\n" . $cgi->submit(-name => 'btnS', -value => 'Search') . - $cgi->end_form() . "\n" . - $cgi->a({-href => href(project => undef, searchtext => undef, - project_filter => $project_filter)}, - esc_html("List all projects$limit")) . "
\n"; + $cgi->end_form() . "\n"; print "\n"; } @@ -6474,6 +6471,16 @@ sub git_project_list_load { sub git_frontpage { my ($projlist, $order); ($projlist, $order) = git_project_list_load(1) if not $frontpage_no_project_list; + + my $limit = ''; + if ($project_filter) { + $limit = " in '$project_filter/'"; + } + my $browse_link = "

" . + $cgi->a({-href => href(project => undef, searchtext => undef, + action=>'project_list', project_filter => $project_filter)}, + esc_html("Browse all projects$limit")) . "

\n"; + git_header_html(); if (defined $home_text && -f $home_text) { print "
\n"; @@ -6482,6 +6489,7 @@ sub git_frontpage { } git_project_search_form($searchtext, $search_use_regexp); if (not $frontpage_no_project_list) { + print $browse_link; git_project_list_body($projlist, $order); } else { my $show_ctags = gitweb_check_feature('ctags'); @@ -6493,9 +6501,7 @@ sub git_frontpage { my $cloud = git_populate_project_tagcloud($ctags, 'project_list'); print git_show_project_tagcloud($cloud, 64); } - print "

" . - $cgi->a({-href => href(action=>'project_list')}, "Browse all projects") . - "

\n"; + print $browse_link; } git_footer_html(); } -- 2.11.4.GIT