From a380c9b55b39a4db6a21131332a2a5629428dded Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jul 2016 01:39:37 +0000 Subject: www: remove old footer generation code and normalize new.html We now generate all of our HTML using WwwStream which forces us to have consistent headers and footers in the HTML itself. This also makes the search-capable vs search-less installs go to the new.html endpoint to maintain consistency (in case an admin decides to enable Xapian). --- lib/PublicInbox/WWW.pm | 42 +----------------------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'lib/PublicInbox/WWW.pm') diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 5de5ffee..2c60d596 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -198,7 +198,6 @@ sub get_index { my ($ctx) = @_; require PublicInbox::Feed; my $srch = searcher($ctx); - footer($ctx); if ($ctx->{env}->{QUERY_STRING} =~ /(?:\A|[&;])q=/) { require PublicInbox::SearchView; PublicInbox::SearchView::sres_top_html($ctx); @@ -227,11 +226,10 @@ sub get_mid_html { my $x = mid2blob($ctx) or return r404($ctx); require PublicInbox::View; - my $foot = footer($ctx); require Email::MIME; my $mime = Email::MIME->new($x); searcher($ctx); - PublicInbox::View::msg_html($ctx, $mime, $foot); + PublicInbox::View::msg_html($ctx, $mime); } # /$INBOX/$MESSAGE_ID/t/ @@ -250,44 +248,6 @@ sub ctx_get { $val; } -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 $env = $ctx->{env}; - my $http = $obj->base_url($env); - chop $http; - $seen{$http} or unshift @urls, $http; - my $ssoma_url = PublicInbox::Hval::prurl($env, SSOMA_URL); - if (scalar(@urls) == 1) { - $urls = "URL for ssoma or git clone --mirror $urls[0]); - } else { - $urls = "URLs for ssoma or git clone --mirror\n) . - join("\n", map { "\tgit clone --mirror $_" } @urls); - } - - my $addr = $obj->{-primary_address}; - $ctx->{footer} = join("\n", - '- ' . $desc, - "A {env}, PI_URL) . - '">public-inbox, ' . - 'anybody may post in plain-text (not HTML):', - $addr, - $urls - ); -} - # search support is optional, returns undef if Xapian is not installed # or not configured for the given GIT_DIR sub searcher { -- cgit v1.2.3-24-ge0c7