From 4c3a9a2b52f9f25d588d9a37f9957a2011b5a091 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Sun, 4 Oct 2020 10:27:04 -0500 Subject: [PATCH] nav length never dips below 7 (+ cluster of 3 on both sides of current page) when page number is low --- src/views/diary.tpl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 1e4f7c1..b76ca4b 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -28,6 +28,13 @@ < % end + % # fill out number cluster to the left when page is high + % if page >= max_pages - cluster: + % for j in range(page - cluster): + {{page + j + cluster + 1}} + % end + % end + % # form cluster of number links around page % for i in range(max(0,page - cluster), min(max_pages + 1,page + cluster + 1)): % # bold current page number @@ -40,9 +47,9 @@ % end % # fill out number cluster to the right when page is low - % if page <= 2 and max_pages > page + 3: + % if page <= cluster - 1 and max_pages > page + cluster: % for j in range(cluster - page): - {{page + j + cluster + 1}} + {{page + j + cluster + 1}} % end % end