You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.6 KiB
Smarty

% rebase('frame.tpl')
<div class="dir-row"> </div>
<div class="diary-dir">
<center>
% 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
<a href=/diary/0><<</a>
% # < points to 0 if page 0 or below
% if page <= 0:
<a href=/diary/0><</a>
% # < points to previous page otherwise
% else:
<a href=/diary/{{page - 1}}><</a>
% end
% # fill out number cluster to the left when page is high
% if page > max_pages - cluster:
% for j in range(cluster - max_pages + page):
<a href=/diary/{{max_pages - cluster * 2 + j}}>{{max_pages - cluster * 2 + j}}</a>
% 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:
<b>{{i}}</b>
% # form neighboring numbers into links
% else:
<a href=/diary/{{i}}>{{i}}</a>
% 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):
<a href=/diary/{{page + j + cluster + 1}}>{{page + j + cluster + 1}}</a>
% end
% end
% # > points to max if page is at or above maximum
% if page >= max_pages:
<a href=/diary/{{max_pages}}>></a>
% # > point to next page otherwise
% else:
<a href=/diary/{{page + 1}}>></a>
% end
% # >> is always active link to maximum page
<a href=/diary/{{max_pages}}>>></a>
</center>
</div>
<!--left column-->
<div class="diary-pages">
% for s in snippets[page * limit:page * limit + limit]:
<div class="snippet">
<div class="snippet-title">
<a href={{s[4]}}>{{!s[0]}}</a>
</div>
<div class="snippet-content">
{{!s[1]}}
</div>
<div class="snippet-info">
{{!s[2]}}{{!s[3]}}
</div>
<div class="snippet-link">
<a href={{s[4]}}>Read More</a>
</div>
</div>
% end
</div>
<!--right column-->
<div class="about-box">
<h1>about blessfrey</h1>
It's a game.<br>
</div>
<div class="twitter-box">
<h1>follow on twitter</h1>
<a href="https://twitter.com/lilchimchooree">@lilchimchooree</a><br>
</div>
<div class="latest">
<h1>latest</h1>
<div class="latest-text">
{{latest}}
</div>
</div>
<div class="disclosure">
<h1>disclosure</h1>
blessfrey.me is not using sponsored posts or affiliate links right now. Any that appear will be <a href="https://www.ftc.gov/tips-advice/business-center/guidance/ftcs-endorsement-guides-what-people-are-asking">properly</a> <a href="https://www.ftc.gov/sites/default/files/attachments/press-releases/ftc-publishes-final-guides-governing-endorsements-testimonials/091005revisedendorsementguides.pdf">disclosed</a>.<br>
<br>
blessfrey.me does not collect personal information + has no cookies. Just a simple dev site.<br>
</div>