]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
view: remove "threadlink" from thread view
[public-inbox.git] / lib / PublicInbox / View.pm
index 660447ddb527624e7ccd666402849274ad8f56e4..3ee67902ca25a54ae4f83ef1ca6d6781dc7fd8c4 100644 (file)
@@ -74,13 +74,10 @@ sub index_entry {
        my $path = $root_anchor ? '../../' : '';
        my $href = $mid->as_href;
        my $irt = $header_obj->header('In-Reply-To');
-       my ($anchor_idx, $anchor, $t_anchor);
+       my ($anchor_idx, $anchor);
        if (defined $irt) {
                $anchor_idx = anchor_for($irt);
                $anchor = $seen->{$anchor_idx};
-               $t_anchor = T_ANCHOR;
-       } else {
-               $t_anchor = '';
        }
        if ($srch) {
                $subj = "<a\nhref=\"${path}t/$href/#u\">$subj</a>";
@@ -134,11 +131,6 @@ sub index_entry {
                $rv .= " <a\nhref=\"$anchor\">parent</a>";
        }
 
-       if ($srch) {
-               $rv .= " <a\nhref=\"${path}t/$href/$t_anchor\">" .
-                      "threadlink</a>";
-       }
-
        $fh->write($rv .= '</pre></td></tr></table>');
 }
 
@@ -390,12 +382,14 @@ sub thread_inline {
        my $mid = mid_compress(mid_clean($cur->header('Message-ID')));
        my $res = $srch->get_thread($mid);
        my $nr = $res->{total};
+
        if ($nr <= 1) {
-               $$dst .= "[only message in thread]\n";
+               $$dst .= "\n[no followups, yet]</a>\n";
                return;
        }
 
-       $$dst .= "roughly $nr messages in thread:\n";
+       $$dst .= "\n\n~$nr messages in thread: ".
+                "(<a\nhref=\"../../t/$mid/#u\">expand</a>)\n";
        my $subj = $srch->subject_path($cur->header('Subject'));
        my $state = {
                seen => { $subj => 1 },
@@ -473,11 +467,6 @@ sub html_footer {
        my $srch = $ctx->{srch} if $ctx;
        my $idx = $standalone ? " <a\nhref=\"../../\">index</a>" : '';
        if ($idx && $srch) {
-               $mid = mid_compress(mid_clean($mid));
-               my $t_anchor = defined $irt ? T_ANCHOR : '';
-               $irt = $mime->header('In-Reply-To');
-               $idx = " <a\nhref=\"../../t/$mid/$t_anchor\">".
-                      "threadlink</a>$idx\n\n";
                my $next = thread_inline(\$idx, $ctx, $mime);
                if (defined $irt) {
                        $irt = PublicInbox::Hval->new_msgid($irt);