From 76c43e9a88ea343f11e26e8c12a4fa3cdb1da6c4 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Fri, 2 Oct 2020 01:00:53 -0500 Subject: [PATCH] first link appears when it's out of -3,+3 range of current page --- src/views/diary.tpl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 07625e6..6785ed9 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -4,13 +4,16 @@
<% - if page < 0: + if page <= 0: page = 0 end - if page > total - 1: - page = total - 1 + if page > int(total - 1 / limit): + page = int(total - 1 / limit) end %> + % if page >= limit + 1: + first + % end % for i in range(max(0,page - limit), min(total,page + limit)): % if i == page: {{i}}