]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: tweak thread/index header slightly
authorEric Wong <e@80x24.org>
Thu, 30 Jun 2016 02:35:19 +0000 (02:35 +0000)
committerEric Wong <e@80x24.org>
Thu, 30 Jun 2016 07:24:47 +0000 (07:24 +0000)
This makes the top permalink/raw as well as the In-Reply-To
show up without search.  While we're at it, try to make
the links on the thread index from the "X siblings, Y replies"
more obvious.

lib/PublicInbox/View.pm

index 0b47c899c03735208f56c491163b139975ee4846..9393d44334ab12d41ad24309d188587dfd41985c 100644 (file)
@@ -119,8 +119,15 @@ sub index_entry {
                my $dst = _hdr_names($hdr, $f);
                push @tocc, "$f: $dst" if $dst ne '';
        }
-       $rv .= "From: "._hdr_names($hdr, 'From').' @ '._msg_date($hdr)." UTC\n";
+       my $mapping = $ctx->{mapping};
+       $rv .= "From: "._hdr_names($hdr, 'From').' @ '._msg_date($hdr)." UTC";
+       my $upfx = $ctx->{-upfx};
+       $rv .= qq{ (<a\nhref="$upfx$mid_raw/">permalink</a> / };
+       $rv .= qq{<a\nhref="$upfx$mid_raw/raw">raw</a>)\n};
        $rv .= '  '.join('; +', @tocc) . "\n" if @tocc;
+       if (!$mapping && $irt) {
+               $rv .= qq(In-Reply-To: &lt;<a\nhref="$upfx$irt/">$irt</a>&gt;\n)
+       }
        $rv .= "\n";
 
        # scan through all parts, looking for displayable text
@@ -173,11 +180,7 @@ sub _th_index_lite {
        if (my $next = $node->next) {
                $rv .= $pad .  $mapping->{$next->messageid}->[1];
        }
-       $rv .= "<a\nhref=#e$id\nid=m$id>.<a>\t\t\t";
-       $rv .= "(<a\nhref=#r$id\n>$s_s, $s_c</a> / ";
-       my $upfx = $ctx->{-upfx};
-       $rv .= qq{<a\nhref="$upfx$mid_raw/">permalink</a> / };
-       $rv .= qq{<a\nhref="$upfx$mid_raw/raw">raw</a>)\n};
+       $rv .= "<a\nhref=#e$id\nid=m$id>_<a> <a\nhref=#r$id\n>$s_s, $s_c</a>\n";
 }
 
 sub walk_thread {