git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Tony Finch <dot@dotat.at>
Date
Mar 19, 2015, 15:40 UTC
Message-ID
<alpine.LSU.2.00.1503191540090.23307@hermes-1.csi.cam.ac.uk>
In-Reply-To
<5e56772f50d3d1498361d8831c4f2fba38d197b4.1426779553.git.dot@dotat.at>

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 073f324..9abc5bc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5549,10 +5549,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.2.1.68.g56d9796
Previous: Tony FinchNext: Tony Finch
Message 2 of 6 in “gitweb: if the PATH_INFO is incomplete, use it as a project_filter”
  1. 2/5 gitweb: if the PATH_INFO is incomplete, use it as a project_filterTony Finch, Mar 19, 2015
  2. 3/5 gitweb: add a link under the search box to clear a project filterTony Finch, Mar 19, 2015
  3. 4/5 gitweb: optionally set project category from its pathnameTony Finch, Mar 19, 2015
  4. 5/5 gitweb: make category headings into links when they are directoriesTony Finch, Mar 19, 2015
  5. Junio C HamanoMar 26, 2015
  6. Tony FinchMar 27, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.