From: Giuseppe Bilotta Date: Thu, 11 Nov 2010 12:26:13 +0000 (+0100) Subject: gitweb: allow action specialization in page header X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/d952c3d6af00cce2d2f7d52b1fabc367a0a1d60c475786aec332919cc48efa36?ds=sidebyside gitweb: allow action specialization in page header 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 Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 241b8f1..e4f292a 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -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"; }