X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwStream.pm;h=8ae35c73931f19f947b0f99a076db6f832ec6e35;hb=c2d12f79e78eb4ea909cac6106880c0f41e8c5fd;hp=ec75f16c50fd07bf57581492de4c7cb1e3584f25;hpb=cfb8d16578e7f2f2e300f9f436205e4a8fc7f322;p=public-inbox.git diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index ec75f16c..8ae35c73 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -2,6 +2,10 @@ # License: AGPL-3.0+ # # HTML body stream for which yields getline+close methods +# +# public-inbox-httpd favors "getline" response bodies to take a +# "pull"-based approach to feeding slow clients (as opposed to a +# more common "push" model) package PublicInbox::WwwStream; use strict; use warnings; @@ -34,10 +38,12 @@ sub _html_top ($) { my $title = $ctx->{-title_html} || $desc; my $upfx = $ctx->{-upfx} || ''; my $help = $upfx.'_/text/help'; + my $color = $upfx.'_/text/color'; my $atom = $ctx->{-atom} || $upfx.'new.atom'; my $tip = $ctx->{-html_tip} || ''; my $top = "$desc"; my $links = "help / ". + "color / ". "Atom feed"; if ($obj->search) { my $q_val = $ctx->{-q_value_html}; @@ -61,7 +67,7 @@ sub _html_top ($) { "$title" . "" . - PublicInbox::Hval::STYLE . + $ctx->{www}->style($upfx) . "". $top . $tip; } @@ -99,11 +105,11 @@ sub _html_end { push @urls, $u =~ /\Ahttps?:/ ? qq($u) : $u; } - if (scalar(@urls) == 1) { - $urls .= " git clone --mirror $urls[0]"; - } else { + if (defined($part) || scalar(@urls) > 1) { $urls .= "\n" . join("\n", map { "\tgit clone --mirror $_" } @urls); + } else { + $urls .= " git clone --mirror $urls[0]"; } if (defined $part) { my $addrs = $obj->{address};