From 013ad596f4304b42dc08b6cd18a72da5b8f944a0 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Thu, 1 Oct 2020 19:13:03 -0500 Subject: [PATCH] added code to prevent diary nav from dipping under 0 and soaring over the total --- src/entries/201003.html | 3 ++- src/views/diary.tpl | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/entries/201003.html b/src/entries/201003.html index 04d00b3..d10039d 100644 --- a/src/entries/201003.html +++ b/src/entries/201003.html @@ -47,7 +47,7 @@
-

weekly roundup

+

this week

september 27-october 3, 2020 bottle, css, git, html, regex, regular expressions, website

@@ -61,6 +61,7 @@ bottle, css, git, html, regex, regular expressions, website

diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 3886503..0344c38 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -2,6 +2,15 @@
+ +<% + if page < 0: + page = 0 + end + if page > total: + page = total + end +%> % for i in range(max(0,page - limit), min(total,page + limit)): % if i == page: {{i}}