From 866000f9a99971bd64b34ad21da440f43e72d753 Mon Sep 17 00:00:00 2001 From: chimchooree Date: Sun, 11 Jul 2021 19:09:39 -0500 Subject: [PATCH] added content back --- src/views/diary-boxes.tpl | 26 ++++- src/views/diary.tpl | 211 +++++++++++++++++++++++++++++++++++++- 2 files changed, 231 insertions(+), 6 deletions(-) diff --git a/src/views/diary-boxes.tpl b/src/views/diary-boxes.tpl index 1f4dadb..0dc71c4 100644 --- a/src/views/diary-boxes.tpl +++ b/src/views/diary-boxes.tpl @@ -2,16 +2,32 @@
- disclosure -
+ Blessfrey.me is not using sponsored posts or affiliate links.
+
+ Blessfrey.me is not collecting personal information + has no cookies.
+
+ Thank you for following the development of Blessfrey.
+ diff --git a/src/views/diary.tpl b/src/views/diary.tpl index 1f6f865..19a81ad 100644 --- a/src/views/diary.tpl +++ b/src/views/diary.tpl @@ -1,13 +1,218 @@ % rebase('frame.tpl') +% import re
+
- << +
+ % max_pages = int((total - 1) / limit) +<% + # page never below 0 + if page <= 0: + page = 0 + end + # page never over maximum + if page > max_pages: + page = max_pages + end +%> +
+ % # << is always active link pointing to 0 + + << + + + % # < points to 0 if page 0 or below + % if page <= 0: + + < + + % # < points to previous page otherwise + % else: + + < + + % end +
+ +
+ % # fill out number cluster to the left when page is high + % if max_pages > cluster and page > max_pages - cluster: + % for j in range(cluster - max_pages + page): + + % 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 + % if i == page: +
+ {{i}} +
+ % # form neighboring numbers into links + % else: +
+ {{i}} +
+ % end + % end + + % # fill out number cluster to the right when page is low + % if page <= cluster - 1 and max_pages > page + cluster: + % for j in range(cluster - page): + + % end + % end +
+ +
+ % # > points to max if page is at or above maximum + % if page >= max_pages: + + > + + % # > point to next page otherwise + % else: + + > + + % end + + % # >> is always active link to maximum page + + >> + +
+
+
- Snippet + % for s in snippets[page * limit:page * limit + limit]: +
+
+

{{!s[0]}}

+
+ +
+ {{!s[1]}} +
+ % if len(s[5]) >= 1: +
+ % for j in s[5]: +
+ {{j}} +
+ % end +
+ % end + + +
+
+
+ % end
+ % include diary-boxes.tpl +
- >> +
+ % max_pages = int((total - 1) / limit) +<% + # page never below 0 + if page <= 0: + page = 0 + end + # page never over maximum + if page > max_pages: + page = max_pages + end +%> +
+ % # << is always active link pointing to 0 + + << + + + % # < points to 0 if page 0 or below + % if page <= 0: + + < + + % # < points to previous page otherwise + % else: + + < + + % end +
+ +
+ % # fill out number cluster to the left when page is high + % if max_pages > cluster and page > max_pages - cluster: + % for j in range(cluster - max_pages + page): + + % 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 + % if i == page: +
+ {{i}} +
+ % # form neighboring numbers into links + % else: +
+ {{i}} +
+ % end + % end + + % # fill out number cluster to the right when page is low + % if page <= cluster - 1 and max_pages > page + cluster: + % for j in range(cluster - page): + + % end + % end + +
+ +
+ % # > points to max if page is at or above maximum + % if page >= max_pages: + + > + + % # > point to next page otherwise + % else: + + > + + % end + % # >> is always active link to maximum page + + >> + +
+