From 47162de3d3de594311126f9e6a61e546b5197376 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Fri, 2 Oct 2020 01:11:18 -0500 Subject: [PATCH] same for link to last page --- src/views/diary.tpl | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 6785ed9..b9a1524 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -4,16 +4,16 @@
<% - if page <= 0: - page = 0 - end - if page > int(total - 1 / limit): - page = int(total - 1 / limit) - end + if page <= 0: + page = 0 + end + if page > int(total - 1 / limit): + page = int(total - 1 / limit) + end %> - % if page >= limit + 1: - first - % end + % if page >= limit + 1: + first + % end % for i in range(max(0,page - limit), min(total,page + limit)): % if i == page: {{i}} @@ -21,6 +21,9 @@ {{i}} % end % end + % if page <= total - limit: + last + % end