-sub footer {
- my ($ctx) = @_;
- return '' unless $ctx;
- my $obj = $ctx->{-inbox} or return '';
-
- # auto-generate a footer
- chomp(my $desc = $obj->description);
- $desc = PublicInbox::Hval::ascii_html($desc);
-
- my $urls;
- my @urls = @{$obj->cloneurl};
- my %seen = map { $_ => 1 } @urls;
- my $cgi = $ctx->{cgi};
- my $http = $cgi->base->as_string . $obj->{name};
- $seen{$http} or unshift @urls, $http;
- my $ssoma_url = PublicInbox::Hval::prurl($ctx->{env}, SSOMA_URL);
- if (scalar(@urls) == 1) {
- $urls = "URL for <a\nhref=\"" . $ssoma_url .
- qq(">ssoma</a> or <b>git clone --mirror $urls[0]</b>);
- } else {
- $urls = "URLs for <a\nhref=\"" . $ssoma_url .
- qq(">ssoma</a> or <b>git clone --mirror</b>\n) .
- join("\n", map { "\tgit clone --mirror $_" } @urls);
- }
-
- my $addr = $obj->{-primary_address};
- $ctx->{footer} = join("\n",
- '- ' . $desc,
- "A <a\nhref=\"" .
- PublicInbox::Hval::prurl($ctx->{cgi}->{env}, PI_URL) .
- '">public-inbox</a>, ' .
- 'anybody may post in plain-text (not HTML):',
- $addr,
- $urls
- );
-}
-