about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-10 01:24:08 +0000
committerEric Wong <e@80x24.org>2016-07-10 01:24:29 +0000
commita8bb6e58a39b98fba6a15628cc3275586d30f17f (patch)
tree9b2a038de9abc825119b7c0b4e6eef1ed2f20335 /lib
parent6af5b6f9822c600f50bdc85ed63902b0e4af9f2f (diff)
downloadpublic-inbox-a8bb6e58a39b98fba6a15628cc3275586d30f17f.tar.gz
We only care about the thread skeleton if we have
multiple messages in a thread, single message threads
can just go to the top of the message.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/View.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 3d6348c7..49068641 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -905,11 +905,18 @@ sub dump_topics {
 
                 # $n isn't the total number of posts on the topic,
                 # just the number of posts in the current results window
-                $n = $n == 1 ? '' : " ($n+ messages)";
+                my $anchor;
+                if ($n == 1) {
+                        $n = '';
+                        $anchor = '#u'; # top of only message
+                } else {
+                        $n = " ($n+ messages)";
+                        $anchor = '#t'; # thread skeleton
+                }
 
                 my $mbox = qq(<a\nhref="$href/t.mbox.gz">mbox.gz</a>);
                 my $atom = qq(<a\nhref="$href/t.atom">Atom</a>);
-                my $s = "<a\nhref=\"$href/T/#t\"><b>$top</b></a>\n" .
+                my $s = "<a\nhref=\"$href/T/$anchor\"><b>$top</b></a>\n" .
                         " $ts UTC $n - $mbox / $atom\n";
                 for (my $i = 0; $i < scalar(@ex); $i += 2) {
                         my $level = $ex[$i];