From: Eric Wong Date: Sat, 20 Aug 2022 08:01:33 +0000 (+0000) Subject: view: do not show pagination footer for small inboxes X-Git-Tag: v1.9.0~4 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=63cafb59760fdb73a15c22210c59fe0f13d79e88;p=public-inbox.git view: do not show pagination footer for small inboxes 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. --- 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[ | latest]; } - "
page: $next$prev
"; + ($next || $prev) ? \"
page: $next$prev
" : \''; } 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 {