added content back
parent
b54c328166
commit
866000f9a9
@ -1,13 +1,218 @@
|
|||||||
% rebase('frame.tpl')
|
% rebase('frame.tpl')
|
||||||
|
% import re
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
|
||||||
<div class="diary-dir top">
|
<div class="diary-dir top">
|
||||||
<<
|
<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
|
||||||
|
%>
|
||||||
|
<div class="diary-dir-left">
|
||||||
|
% # << is always active link pointing to 0
|
||||||
|
<a href=/diary/0>
|
||||||
|
<img src="/static/img/btn/nav_ll.png" alt="<<" width="33" height="29">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
% # < points to 0 if page 0 or below
|
||||||
|
% if page <= 0:
|
||||||
|
<a href=/diary/0>
|
||||||
|
<img src="/static/img/btn/nav_l.png" alt="<" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% # < points to previous page otherwise
|
||||||
|
% else:
|
||||||
|
<a href=/diary/{{page - 1}}>
|
||||||
|
<img src="/static/img/btn/nav_l.png" alt="<" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% end
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="diary-dir-numbers">
|
||||||
|
% # 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):
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{max_pages - cluster * 2 + j}} rel="nofollow">{{max_pages - cluster * 2 + j}}</a>
|
||||||
|
</div>
|
||||||
|
% 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:
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<b>{{i}}</b>
|
||||||
|
</div>
|
||||||
|
% # form neighboring numbers into links
|
||||||
|
% else:
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{i}} rel="nofollow">{{i}}</a>
|
||||||
|
</div>
|
||||||
|
% 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):
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{page + j + cluster + 1}} rel="nofollow">{{page + j + cluster + 1}}</a>
|
||||||
|
</div>
|
||||||
|
% end
|
||||||
|
% end
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="diary-dir-right">
|
||||||
|
% # > points to max if page is at or above maximum
|
||||||
|
% if page >= max_pages:
|
||||||
|
<a href=/diary/{{max_pages}}>
|
||||||
|
<img src="/static/img/btn/nav_r.png" alt=">" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% # > point to next page otherwise
|
||||||
|
% else:
|
||||||
|
<a href=/diary/{{page + 1}}>
|
||||||
|
<img src="/static/img/btn/nav_r.png" alt=">" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% end
|
||||||
|
|
||||||
|
% # >> is always active link to maximum page
|
||||||
|
<a href=/diary/{{max_pages}}>
|
||||||
|
<img src="/static/img/btn/nav_rr.png" alt=">>" width="33" height="29">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</center>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="diary-pages">
|
<div class="diary-pages">
|
||||||
Snippet
|
% for s in snippets[page * limit:page * limit + limit]:
|
||||||
|
<div class="snippet">
|
||||||
|
<div class="snippet-title">
|
||||||
|
<a href={{s[3]}} rel="nofollow"><h1>{{!s[0]}}</h1></a>
|
||||||
|
</div>
|
||||||
|
<div class="date-line">
|
||||||
|
<b>chimchooree</b>
|
||||||
|
• <b>{{!s[2]}}</b>
|
||||||
|
</div>
|
||||||
|
<div class="snippet-content">
|
||||||
|
{{!s[1]}}
|
||||||
|
</div>
|
||||||
|
% if len(s[5]) >= 1:
|
||||||
|
<div class=snippet-tags>
|
||||||
|
% for j in s[5]:
|
||||||
|
<div class="snippet-tag">
|
||||||
|
{{j}}
|
||||||
|
</div>
|
||||||
|
% end
|
||||||
|
</div>
|
||||||
|
% end
|
||||||
|
<div class="social-line">
|
||||||
|
<a class="social-link social-twitter" href='http://twitter.com/share?text={{s[4]}}&url=https://blessfrey.me{{s[3]}}&via=lilchimchooree' target="_blank">tweet</a>
|
||||||
|
</div>
|
||||||
|
<div class="snippet-link">
|
||||||
|
<a href={{s[3]}}>
|
||||||
|
<img src="/static/img/btn/diaryreadmore.png" alt="read more" width="99" height="84">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="snippet-bottom">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
% end
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
% include diary-boxes.tpl
|
% include diary-boxes.tpl
|
||||||
|
|
||||||
<div class="diary-dir bottom">
|
<div class="diary-dir bottom">
|
||||||
>>
|
<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
|
||||||
|
%>
|
||||||
|
<div class="diary-dir-left">
|
||||||
|
% # << is always active link pointing to 0
|
||||||
|
<a href=/diary/0>
|
||||||
|
<img src="/static/img/btn/nav_ll.png" alt="<<" width="33" height="29">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
% # < points to 0 if page 0 or below
|
||||||
|
% if page <= 0:
|
||||||
|
<a href=/diary/0>
|
||||||
|
<img src="/static/img/btn/nav_l.png" alt="<" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% # < points to previous page otherwise
|
||||||
|
% else:
|
||||||
|
<a href=/diary/{{page - 1}}>
|
||||||
|
<img src="/static/img/btn/nav_l.png" alt="<" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% end
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="diary-dir-numbers">
|
||||||
|
% # 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):
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{max_pages - cluster * 2 + j}} rel="nofollow">{{max_pages - cluster * 2 + j}}</a>
|
||||||
|
</div>
|
||||||
|
% 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:
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<b>{{i}}</b>
|
||||||
|
</div>
|
||||||
|
% # form neighboring numbers into links
|
||||||
|
% else:
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{i}} rel="nofollow">{{i}}</a>
|
||||||
|
</div>
|
||||||
|
% 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):
|
||||||
|
<div class="diary-dir-number">
|
||||||
|
<a href=/diary/{{page + j + cluster + 1}} rel="nofollow">{{page + j + cluster + 1}}</a>
|
||||||
|
</div>
|
||||||
|
% end
|
||||||
|
% end
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="diary-dir-right">
|
||||||
|
% # > points to max if page is at or above maximum
|
||||||
|
% if page >= max_pages:
|
||||||
|
<a href=/diary/{{max_pages}}>
|
||||||
|
<img src="/static/img/btn/nav_r.png" alt=">" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% # > point to next page otherwise
|
||||||
|
% else:
|
||||||
|
<a href=/diary/{{page + 1}}>
|
||||||
|
<img src="/static/img/btn/nav_r.png" alt=">" width="27" height="29">
|
||||||
|
</a>
|
||||||
|
% end
|
||||||
|
% # >> is always active link to maximum page
|
||||||
|
<a href=/diary/{{max_pages}}>
|
||||||
|
<img src="/static/img/btn/nav_rr.png" alt=">>" width="33" height="29">
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</center>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue