# [PATCH 3/5] gitweb: add a link under the search box to clear a project filter

1 messages from 2014-07-31 to 2014-07-31. Participants: Tony Finch.
Thread: https://gitlist.dev/t/37259

## Tony Finch, 2014-07-31 12:53

Subject: [PATCH 3/5] gitweb: add a link under the search box to clear a project filter
Message-ID: <alpine.LSU.2.00.1407311353440.23775@hermes-1.csi.cam.ac.uk>
URL: https://gitlist.dev/e/alpine.LSU.2.00.1407311353440.23775%40hermes-1.csi.cam.ac.uk

```
Previously when a project filter was active, the only simple way
to clear it was by clicking the home link in the breadcrumbs, which
is not very obvious.

This change adds another home link under the search box which clears
both project filter and search, next to the existing link that
clears the search and keeps the project filter.

Signed-off-by: Tony Finch <dot@dotat.at>
---
 gitweb/gitweb.perl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 12aba8f..d1e6b79 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5545,10 +5545,13 @@ 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,
-	                             project_filter => $project_filter)},
-	              esc_html("List all projects$limit")) . "<br />\n";
-	print "</div>\n";
+	      $cgi->a({-href => $my_uri}, esc_html("List all projects"));
+	print " / " .
+	      $cgi->a({-href => href(project => undef, action => "project_list",
+				     project_filter => $project_filter)},
+	              esc_html("List projects$limit"))
+	    if $project_filter;
+	print "<br />\n</div>\n";
 }

 # entry for given @keys needs filling if at least one of keys in list
-- 
2.1.0.rc0.229.gaee38de

```
