about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-20 08:01:33 +0000
committerEric Wong <e@80x24.org>2022-08-20 18:30:56 +0000
commit63cafb59760fdb73a15c22210c59fe0f13d79e88 (patch)
tree020ff4d22b5a85a764d1c40ff5ec46822d4e161b /lib/PublicInbox/View.pm
parent2093629bc108e7ce17d932738f692eaa9721c1dd (diff)
downloadpublic-inbox-63cafb59760fdb73a15c22210c59fe0f13d79e88.tar.gz
For new public inboxes with few messages, the dead pagination
footer is a worthless and confusing waste of space: "page: \n";
without `next' or `prev' links for users to follow.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 26094082..c28505f1 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -1192,7 +1192,7 @@ sub pagination_footer ($$) {
                 $next = $next ? "$next | " : '             | ';
                 $prev .= qq[ | <a\nhref="$latest">latest</a>];
         }
-        "<hr><pre>page: $next$prev</pre>";
+        ($next || $prev) ? \"<hr><pre>page: $next$prev</pre>" : \'';
 }
 
 sub paginate_recent ($$) {
@@ -1243,11 +1243,8 @@ sub paginate_recent ($$) {
 sub index_topics {
         my ($ctx) = @_;
         my $msgs = paginate_recent($ctx, 200); # 200 is our window
-        if (@$msgs) {
-                walk_thread(thread_results($ctx, $msgs), $ctx, \&acc_topic);
-        }
-        html_oneshot($ctx, dump_topics($ctx), \pagination_footer($ctx, '.'));
-
+        walk_thread(thread_results($ctx, $msgs), $ctx, \&acc_topic) if @$msgs;
+        html_oneshot($ctx, dump_topics($ctx), pagination_footer($ctx, '.'));
 }
 
 sub thread_adj_level {