Skip to content

Commit

Permalink
gitweb: show active project_filter in project_list page header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bernhard R. Link authored and Junio C Hamano committed Feb 1, 2012
1 parent 56efd9d commit 40efa22
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = @_;

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

Expand Down

0 comments on commit 40efa22

Please sign in to comment.