X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwStream.pm;h=958251a347d55edc89a8501773e325c90460749e;hb=37526779e4c544b134af74f43d6c26569cb8e466;hp=e27da8c2ed0f0b6bf359ac10760857032b6ebab3;hpb=4e60d74e6cab0a134c0c62785c766b5fa02ac360;p=public-inbox.git diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm index e27da8c2..958251a3 100644 --- a/lib/PublicInbox/WwwStream.pm +++ b/lib/PublicInbox/WwwStream.pm @@ -12,11 +12,12 @@ our @EXPORT_OK = qw(html_oneshot); use bytes (); # length use PublicInbox::Hval qw(ascii_html prurl ts2str); our $TOR_URL = 'https://www.torproject.org/'; -our $CODE_URL = 'https://public-inbox.org/public-inbox.git'; +our $CODE_URL = [ qw(http://ou63pmih66umazou.onion/public-inbox.git + https://public-inbox.org/public-inbox.git) ]; sub base_url ($) { my $ctx = shift; - my $base_url = $ctx->{-inbox}->base_url($ctx->{env}); + my $base_url = $ctx->{ibx}->base_url($ctx->{env}); chop $base_url; # no trailing slash for clone $base_url; } @@ -35,7 +36,7 @@ sub async_eml { # for async_blob_cb sub html_top ($) { my ($ctx) = @_; - my $ibx = $ctx->{-inbox}; + my $ibx = $ctx->{ibx}; my $desc = ascii_html($ibx->description); my $title = delete($ctx->{-title_html}) // $desc; my $upfx = $ctx->{-upfx} || ''; @@ -54,7 +55,7 @@ sub html_top ($) { qq(color / ). qq(mirror / ). qq(Atom feed); - if ($ibx->search) { + if ($ibx->isrch) { my $q_val = delete($ctx->{-q_value_html}) // ''; $q_val = qq(\nvalue="$q_val") if $q_val ne ''; # XXX gross, for SearchView.pm @@ -76,6 +77,28 @@ sub html_top ($) { '
'. $top . (delete($ctx->{-html_tip}) // ''); } +sub coderepos ($) { + my ($ctx) = @_; + my $cr = $ctx->{ibx}->{coderepo} // return (); + my $cfg = $ctx->{www}->{pi_cfg}; + my $upfx = ($ctx->{-upfx} // ''). '../'; + my @ret; + for my $cr_name (@$cr) { + my $urls = $cfg->{"coderepo.$cr_name.cgiturl"} // next; + $ret[0] //= <'.join("\n\n", $desc, $urls, + coderepos($ctx), code_footer($ctx->{env}) ).'