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";
}
"\n</div>\n";
}
+sub format_repo_url {
+ my ($name, $url) = @_;
+ return "<tr class=\"metadata_url\"><td>$name</td><td>$url</td></tr>\n";
+}
+
sub print_local_time {
print format_local_time(@_);
}
@url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
foreach my $git_url (@url_list) {
next unless $git_url;
- print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
+ print format_repo_url($url_tag, $git_url);
$url_tag = "";
}
or die_error(403, "Remote heads view is disabled");
my $head = git_get_head_hash($project);
- git_header_html();
- git_print_page_nav('','', $head,undef,$head,format_ref_views('remotes'));
- git_print_header_div('summary', $project);
+ my $remote = $input_params{'hash'};
+
+ my @remotelist;
+
+ if (defined $remote) {
+ # only display the heads in a given remote, stripping the
+ # remote name which is already visible elsewhere
+ @remotelist = map {
+ my $ref = $_ ;
+ $ref->{'name'} =~ s!^$remote/!!;
+ $ref
+ } git_get_heads_list(undef, "remotes/$remote");
+ } else {
+ @remotelist = git_get_heads_list(undef, 'remotes');
+ }
+
+ git_header_html(undef, undef, -action_extra => $remote);
+ git_print_page_nav('', '', $head, undef, $head,
+ format_ref_views($remote ? '' : 'remotes'));
+
+ if (defined $remote) {
+ git_print_header_div('remotes', "$remote remote for $project");
+ } else {
+ git_print_header_div('summary', "$project remotes");
+ }
- my @remotelist = git_get_heads_list(undef, 'remotes');
if (@remotelist) {
git_heads_body(\@remotelist, $head);
}
+
git_footer_html();
}