olddoc user/dev discussion/patches/bugs/etc
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: olddoc-public@80x24.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH] tail: support multiple URLs for archives
Date: Sat,  9 Jan 2016 22:15:59 +0000	[thread overview]
Message-ID: <20160109221559.6482-1-e@80x24.org> (raw)

The more archives, the better.
---
 lib/oldweb/_tail.rhtml | 32 +++++++++++++++++---------------
 1 file changed, 17 insertions(+), 15 deletions(-)

diff --git a/lib/oldweb/_tail.rhtml b/lib/oldweb/_tail.rhtml
index 0879572..fda210d 100644
--- a/lib/oldweb/_tail.rhtml
+++ b/lib/oldweb/_tail.rhtml
@@ -1,21 +1,23 @@
 <%
 public_email = @old_cfg['public_email']
 private_email = @old_cfg['private_email']
-ml_url = @old_cfg['ml_url']
-nntp_url = @old_cfg['nntp_url']
-
-if public_email && ml_url %><hr /><pre>
+archive_urls = Array(@old_cfg['ml_url']).concat(Array(@old_cfg['nntp_url']))
+if url = archive_urls.shift %><hr /><pre>
 mail archives: <a
-href="<%= ml_url %>"><%= ml_url %></a> mailto:<a
-href="mailto:<%= public_email %>"><%=
-public_email
-%></a>
-<% end
-if nntp_url %>NNTP archives: <a
-href="<%= nntp_url %>"><%= nntp_url %></a>
+href="<%= url %>"><%= url %></a><%
+  archive_urls.each do |u| %>
+	<a
+href="<%= u %>"><%= u %></a> <%
+  end # archive_urls.each
+  if private_email || public_email %>
 <%
-end
-if private_email
-%>private mail: <a
+    if public_email %>public: <a
+href="mailto:<%= public_email %>"><%= public_email %></a><%
+    end
+    if private_email || public_email %> / <% end
+    if private_email %>private: <a
 href="mailto:<%= private_email %>"><%= private_email %></a><%
-end %></pre>
+    end
+  end
+end
+%></pre>
-- 
EW


             reply	other threads:[~2016-01-09 22:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-09 22:15 Eric Wong [this message]
2016-01-09 22:28 ` [PATCH 2/1] tail: fix divider when private email does not exist Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://80x24.org/olddoc/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160109221559.6482-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=olddoc-public@80x24.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/olddoc.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).