about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-04 19:12:39 +0000
committerEric Wong <e@80x24.org>2022-10-05 21:15:46 +0000
commit5afdc69bf871ab74780b2ae59d5ca37b85840836 (patch)
treeeafd2d07fc8c741f9ea40eb2d19df65185c4574a /lib/PublicInbox/WwwStream.pm
parentf35d722d38e571458fc413b9f0d7ddd788ec4b98 (diff)
downloadpublic-inbox-5afdc69bf871ab74780b2ae59d5ca37b85840836.tar.gz
www_stream: use git->pub_urls for coderepo links
This is already used by */$OID/s/, so just reuse existing code
and make git->local_nick use the assigned nick from the config
file, if there is one.
Diffstat (limited to 'lib/PublicInbox/WwwStream.pm')
-rw-r--r--lib/PublicInbox/WwwStream.pm17
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/PublicInbox/WwwStream.pm b/lib/PublicInbox/WwwStream.pm
index 92d243eb..f5b4df9f 100644
--- a/lib/PublicInbox/WwwStream.pm
+++ b/lib/PublicInbox/WwwStream.pm
@@ -98,16 +98,13 @@ sub coderepos ($) {
         my @ret = ('<a id=code>' .
                 'Code repositories for project(s) associated with this '.
                 $ctx->{ibx}->thing_type . "\n");
-        for my $cr_name (@$cr) {
-                my $urls = $cfg->get_all("coderepo.$cr_name.cgiturl");
-                if ($urls) {
-                        for (@$urls) {
-                                my $u = m!\A(?:[a-z\+]+:)?//! ? $_ : $pfx.$_;
-                                $u = ascii_html(prurl($ctx->{env}, $u));
-                                $ret[0] .= qq(\n\t<a\nhref="$u">$u</a>);
-                        }
-                } else {
-                        $ret[0] .= qq[\n\t$cr_name.git (no URL configured)];
+        my $objs = $cfg->repo_objs($ctx->{ibx});
+        for my $git (@$objs) {
+                my @urls = $git->pub_urls($ctx->{env});
+                for (@urls) {
+                        my $u = m!\A(?:[a-z\+]+:)?//! ? $_ : $pfx.$_;
+                        $u = ascii_html(prurl($ctx->{env}, $u));
+                        $ret[0] .= qq(\n\t<a\nhref="$u">$u</a>);
                 }
         }
         @ret; # may be empty, this sub is called as an arg for join()