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

Re: [PATCH v5 4/5] gitweb: show active project_filter in project_list page header

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 30, 2012, 16:38 UTC
Message-ID
<201201301738.31982.jnareb@gmail.com>
In-Reply-To
<20120130114852.GD9267@server.brlink.eu>
On Mon, 30 Jan 2012, Bernhard R. Link wrote:
> In a project_list view show breadcrumbs with the currently active
> project_filter (and those of parent directories) in the page header.
O.K. (though I'd prefer written it less concise and more clear).
 
Show 16 quoted lines
> Signed-off-by: Bernhard R. Link <brlink@debian.org>
> ---
>  gitweb/gitweb.perl |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)
> 
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index e022e11..dfc79df 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3836,6 +3836,18 @@ sub print_header_links {
>  	}
>  }
>  
> +sub print_nav_breadcrumbs_path {
> +	my $dirprefix = undef;
> +	while (my $part = shift) {
Hmmm... using agument list directly, without copying it?  Well, all right.
Show 5 quoted lines
> +		$dirprefix .= "/" if defined $dirprefix;
> +		$dirprefix .= $part;
> +		print $cgi->a({-href => href(project => undef,
> +		                             project_filter => $dirprefix,
> +					     action=>"project_list")},
Minor nitpick: Let's use same whitespace rules for all key-value pairs
  +					     action => "project_list")},
Show 15 quoted lines
> +			      esc_html($part)) . " / ";
> +	}
> +}
> +
>  sub print_nav_breadcrumbs {
>  	my %opts = @_;
>  
> @@ -3854,6 +3866,8 @@ sub print_nav_breadcrumbs {
>  			print " / $opts{-action_extra}";
>  		}
>  		print "\n";
> +	} elsif (defined $project_filter) {
> +		print_nav_breadcrumbs_path(split '/', $project_filter);
>  	}
>  }
Nice!
-- 
Jakub Narebski
Poland
Previous: Bernhard R. LinkNext: Bernhard R. Link
Message 38 of 40 in “gitweb: add project_filter to limit project list to a subdirectory”
  1. 1/2 gitweb: add project_filter to limit project list to a subdirectoryBernhard R. Link, Jan 28, 2012
  2. 2/2 gitweb: place links to parent directories in page headerBernhard R. Link, Jan 28, 2012
  3. Jakub NarebskiJan 28, 2012
  4. Jakub NarebskiJan 28, 2012
  5. gitweb: add project_filter to limit project list to a subdirectoryBernhard R. Link, Jan 29, 2012
  6. Jakub NarebskiJan 29, 2012
  7. 1/2 gitweb: add project_filter to limit project list to a subdirectoryBernhard R. Link, Jan 29, 2012
  8. 2/2 gitweb: place links to parent directories in page headerBernhard R. Link, Jan 29, 2012
  9. Jakub NarebskiJan 29, 2012
  10. Jakub NarebskiJan 29, 2012
  11. Junio C HamanoJan 29, 2012
  12. Jakub NarebskiJan 29, 2012
  13. Bernhard R. LinkJan 30, 2012
  14. 1/5 gitweb: prepare git_get_projects_list for use outside 'forks'.Bernhard R. Link, Jan 30, 2012
  15. Jakub NarebskiJan 30, 2012
  16. 1/5 gitweb: prepare git_get_projects_list for use outside 'forks'.Bernhard R. Link, Jan 30, 2012
  17. Jakub NarebskiJan 30, 2012
  18. Bernhard R. LinkJan 30, 2012
  19. 2/5 gitweb: add project_filter to limit project list to a subdirectoryBernhard R. Link, Jan 30, 2012
  20. Jakub NarebskiJan 30, 2012
  21. Bernhard R. LinkJan 30, 2012
  22. 1/6 gitweb: move hard coded .git suffix out of git_get_projects_listBernhard R. Link, Jan 30, 2012
  23. 2/6 gitweb: prepare git_get_projects_list for use outside 'forks'.Bernhard R. Link, Jan 30, 2012
  24. 3/6 gitweb: add project_filter to limit project list to a subdirectoryBernhard R. Link, Jan 30, 2012
  25. 4/6 gitweb: limit links to alternate forms of project_list to active project_filterBernhard R. Link, Jan 30, 2012
  26. 5/6 gitweb: show active project_filter in project_list page headerBernhard R. Link, Jan 30, 2012
  27. 6/6 gitweb: place links to parent directories in page headerBernhard R. Link, Jan 30, 2012
  28. Junio C HamanoJan 30, 2012
  29. Jakub NarebskiJan 30, 2012
  30. Junio C HamanoJan 30, 2012
  31. Junio C HamanoJan 30, 2012
  32. Bernhard R. LinkJan 30, 2012
  33. Bernhard R. LinkFeb 1, 2012
  34. Junio C HamanoFeb 1, 2012
  35. 3/5 gitweb: limit links to alternate forms of project_list to active project_filterBernhard R. Link, Jan 30, 2012
  36. Jakub NarebskiJan 30, 2012
  37. 4/5 gitweb: show active project_filter in project_list page headerBernhard R. Link, Jan 30, 2012
  38. Jakub NarebskiJan 30, 2012
  39. 5/5 gitweb: place links to parent directories in page headerBernhard R. Link, Jan 30, 2012
  40. Jakub NarebskiJan 30, 2012

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.