]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: allow action specialization in page header
authorGiuseppe Bilotta <redacted>
Thu, 11 Nov 2010 12:26:13 +0000 (13:26 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:51:30 +0000 (00:51 -0400)
An optional -action_extra parameter is given to git_header_html() to
identify a variant of the action that is being displayed. For example,
this can be used to specify that the remotes view is being used for a
specific remote and not to display all remotes.

When -action_extra is provided, the action name in the header will be
turned into a link to the action without any arguments or parameters, to
provide a quick link to the non-specific variant of the action.

Signed-off-by: Giuseppe Bilotta <redacted>
Acked-by: Jakub Narebski <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 241b8f1bd266ed6c06fde890b98a02b0714849afaa3a707d781ab4dcc6ee1a07..e4f292add74a2edc8d3060dcd3e9ba084fdfc77a1cc6f7ea8ffb000cd85b630a 100755 (executable)
@@ -3525,7 +3525,15 @@ EOF
        if (defined $project) {
                print $cgi->a({-href => href(action=>"summary")}, esc_html($project));
                if (defined $action) {
-                       print " / $action";
+                       my $action_print = $action ;
+                       if (defined $opts{-action_extra}) {
+                               $action_print = $cgi->a({-href => href(action=>$action)},
+                                       $action);
+                       }
+                       print " / $action_print";
+               }
+               if (defined $opts{-action_extra}) {
+                       print " / $opts{-action_extra}";
                }
                print "\n";
        }
This page took 0.267678 seconds and 4 git commands to generate.