]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: show active project_filter in project_list page header
authorBernhard R. Link <redacted>
Mon, 30 Jan 2012 20:09:43 +0000 (21:09 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:31 +0000 (00:51 -0400)
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 <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 514f26354fb21f6dd986ee9e71082fa15fc5938ffb87c31d5c64e244be60744d..c242588ce5b89870ed5addf6f9f26b3eab6a46c134fc496e440782c0dc0a23e7 100755 (executable)
@@ -3842,6 +3842,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 = @_;
 
@@ -3860,6 +3872,8 @@ sub print_nav_breadcrumbs {
                        print " / $opts{-action_extra}";
                }
                print "\n";
+       } elsif (defined $project_filter) {
+               print_nav_breadcrumbs_path(split '/', $project_filter);
        }
 }
 
This page took 0.340592 seconds and 4 git commands to generate.