]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: show thread size when linking to summary
authorEric Wong <e@80x24.org>
Thu, 30 Jun 2016 08:39:35 +0000 (08:39 +0000)
committerEric Wong <e@80x24.org>
Thu, 30 Jun 2016 08:57:24 +0000 (08:57 +0000)
This should give readers a better idea of what to expect.

lib/PublicInbox/View.pm

index 22d725009366b79e596f11da1752c6ab648a9eee..fac53eb9650ec986ca0300ce42b1be2d9e5bb11f 100644 (file)
@@ -156,7 +156,7 @@ sub index_entry {
                }
                $rv .= " / [<a\nhref=\"${mhref}T/#u\">$flat</a>";
                $rv .= "|<a\nhref=\"${mhref}t/#u\">$threaded</a>]";
-               $rv .= " / <a\nhref=#r$id>thread overview</a>";
+               $rv .= " / <a\nhref=#r$id>$ctx->{s_nr}</a>";
        }
 
        $rv .= $more ? "\n\n" : "\n";
@@ -226,7 +226,8 @@ sub _th_index_lite {
                        $rv .= $pad . $mapping->{$nn->messageid}->[1];
                }
        }
-       $rv .= "<a\nhref=#e$id\nid=m$id>_</a> <a\nhref=#r$id>$s_s, $s_c</a>\n";
+       $rv .= "<a\nhref=#e$id\nid=m$id>_</a> ";
+       $rv .= "<a\nhref=#r$id>$s_s, $s_c; $ctx->{s_nr}</a>\n";
 }
 
 sub walk_thread {
@@ -319,6 +320,7 @@ sub thread_html {
        $ctx->{root_anchor} = anchor_for($mid);
        $ctx->{seen} = {};
        $ctx->{mapping} = {};
+       $ctx->{s_nr} = "$nr+ messages in thread";
 
        my $th = thread_results($msgs);
        walk_thread($th, $ctx, *pre_thread);