From: Bernhard R. Link Date: Mon, 30 Jan 2012 20:09:43 +0000 (+0100) Subject: gitweb: show active project_filter in project_list page header X-Git-Tag: v1.7.10-rc0~84^2~4 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40efa22309458546a3ea861689034acf9fbf9d1a;p=git.git gitweb: show active project_filter in project_list page header In the page header of a project_list view with a project_filter given show breadcrumbs in the page headers showing which directory it is currently limited to and also containing links to the parent directories. Signed-off-by: Bernhard R. Link Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ecd4a39d2..7d36f563e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -3839,6 +3839,18 @@ sub print_header_links { } } +sub print_nav_breadcrumbs_path { + my $dirprefix = undef; + while (my $part = shift) { + $dirprefix .= "/" if defined $dirprefix; + $dirprefix .= $part; + print $cgi->a({-href => href(project => undef, + project_filter => $dirprefix, + action => "project_list")}, + esc_html($part)) . " / "; + } +} + sub print_nav_breadcrumbs { my %opts = @_; @@ -3857,6 +3869,8 @@ sub print_nav_breadcrumbs { print " / $opts{-action_extra}"; } print "\n"; + } elsif (defined $project_filter) { + print_nav_breadcrumbs_path(split '/', $project_filter); } }