]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: allow expanding directly to "nested" view
authorEric Wong <e@80x24.org>
Sat, 3 Feb 2018 02:50:46 +0000 (02:50 +0000)
committerEric Wong <e@80x24.org>
Sat, 3 Feb 2018 02:53:58 +0000 (02:53 +0000)
Sometimes, it can be desirable to jump directly to the "nested"
view when viewing a thread skeleton.  This makes it possible.
While we're at it, shorten some of the text to ensure it still
fits in 80 columns.

lib/PublicInbox/View.pm

index 0de53cb22ec7ba2c865caf253005ad33f089d853..65d7d019b3018d40f1880b9d7e4bfe62722cfe7c 100644 (file)
@@ -576,26 +576,27 @@ sub thread_skel {
        my $mid = mid_clean($hdr->header_raw('Message-ID'));
        my $sres = $srch->get_thread($mid);
        my $nr = $sres->{total};
-       my $expand = qq(<a\nhref="${tpfx}T/#u">expand</a> ) .
-                       qq(/ <a\nhref="${tpfx}t.mbox.gz">mbox.gz</a> ) .
-                       qq(/ <a\nhref="${tpfx}t.atom">Atom feed</a>);
+       my $expand = qq(expand[<a\nhref="${tpfx}T/#u">flat</a>) .
+                       qq(|<a\nhref="${tpfx}t/#u">nested</a>]  ) .
+                       qq(<a\nhref="${tpfx}t.mbox.gz">mbox.gz</a>  ) .
+                       qq(<a\nhref="${tpfx}t.atom">Atom feed</a>);
 
        my $parent = in_reply_to($hdr);
        $$dst .= "\n<b>Thread overview: </b>";
        if ($nr <= 1) {
                if (defined $parent) {
-                       $$dst .= "($expand)\n ";
+                       $$dst .= "$expand\n ";
                        $$dst .= ghost_parent("$tpfx../", $parent) . "\n";
                } else {
-                       $$dst .= "[no followups, yet] ($expand)\n";
+                       $$dst .= "[no followups] $expand\n";
                }
                $ctx->{next_msg} = undef;
                $ctx->{parent_msg} = $parent;
                return;
        }
 
-       $$dst .= "$nr+ messages in thread ($expand";
-       $$dst .= qq! / <a\nhref="#b">[top]</a>)\n!;
+       $$dst .= "$nr+ messages $expand";
+       $$dst .= qq!  <a\nhref="#b">top</a>\n!;
 
        my $subj = $hdr->header('Subject');
        defined $subj or $subj = '';