Skip to content

Commit 40efa22

Browse files
Bernhard R. Linkgitster
authored andcommitted
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 <[email protected]> Acked-by: Jakub Narebski <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 56efd9d commit 40efa22

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

gitweb/gitweb.perl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3839,6 +3839,18 @@ sub print_header_links {
38393839
}
38403840
}
38413841

3842+
sub print_nav_breadcrumbs_path {
3843+
my $dirprefix = undef;
3844+
while (my $part = shift) {
3845+
$dirprefix .= "/" if defined $dirprefix;
3846+
$dirprefix .= $part;
3847+
print $cgi->a({-href => href(project => undef,
3848+
project_filter => $dirprefix,
3849+
action => "project_list")},
3850+
esc_html($part)) . " / ";
3851+
}
3852+
}
3853+
38423854
sub print_nav_breadcrumbs {
38433855
my %opts = @_;
38443856

@@ -3857,6 +3869,8 @@ sub print_nav_breadcrumbs {
38573869
print " / $opts{-action_extra}";
38583870
}
38593871
print "\n";
3872+
} elsif (defined $project_filter) {
3873+
print_nav_breadcrumbs_path(split '/', $project_filter);
38603874
}
38613875
}
38623876

0 commit comments

Comments
 (0)