unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] view: consistent links for per-message views
@ 2015-12-02  2:47 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-12-02  2:47 UTC (permalink / raw)
  To: meta

Just because a message is currently alone does not mean
the links won't be valid in the future when more messages
show up.
---
 lib/PublicInbox/View.pm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index a3a955b..d8fb1cb 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -463,15 +463,17 @@ sub thread_inline {
 	my $mid = mid_clean($cur->header('Message-ID'));
 	my $res = $srch->get_thread($mid);
 	my $nr = $res->{total};
+	my $upfx = $full_pfx ? '' : '../';
+	my $expand = "(<a\nhref=\"${upfx}t/#u\">expand</a> " .
+			"/ <a\nhref=\"${upfx}t.mbox.gz\">mbox.gz</a>)";
 
 	if ($nr <= 1) {
-		$$dst .= "\n[no followups, yet]\n";
+		$$dst .= "\n[no followups, yet] $expand\n";
 		return (undef, in_reply_to($cur));
 	}
-	my $upfx = $full_pfx ? '' : '../';
 
-	$$dst .= "\n\n~$nr messages in thread: ".
-		 "(<a\nhref=\"${upfx}t/#u\">expand</a>)\n";
+	$$dst .= "\n\n~$nr messages in thread: $expand\n";
+
 	my $subj = $srch->subject_path($cur->header('Subject'));
 	my $parent = in_reply_to($cur);
 	my $state = {
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-02  2:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-02  2:47 [PATCH] view: consistent links for per-message views Eric Wong

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).