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 <brlink@debian.org>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Bernhard R. Link 2012-01-30 21:09:43 +01:00 committed by Junio C Hamano
parent 56efd9d252
commit 40efa22309

View File

@ -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);
}
}