|
|
|
@ -3,7 +3,9 @@
|
|
|
|
|
<div class="dir-row"> </div>
|
|
|
|
|
<div class="diary-dir">
|
|
|
|
|
<center>
|
|
|
|
|
% max_pages = int(total - 1 / limit)
|
|
|
|
|
% max_pages = int((total - 1) / limit)
|
|
|
|
|
% cluster = 3
|
|
|
|
|
|
|
|
|
|
<%
|
|
|
|
|
if page <= 0:
|
|
|
|
|
page = 0
|
|
|
|
@ -20,7 +22,7 @@
|
|
|
|
|
<a href=/diary/{{page - 1}}><</a>
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
% for i in range(max(0,page - limit), min(total,page + limit + 1)):
|
|
|
|
|
% for i in range(max(0,page - cluster), min(max_pages + 1,page + cluster + 1)):
|
|
|
|
|
% if i == page:
|
|
|
|
|
<b>{{i}}</b>
|
|
|
|
|
% else:
|
|
|
|
@ -28,19 +30,19 @@
|
|
|
|
|
% end
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
% if page <= 2:
|
|
|
|
|
% for j in range(3 - page):
|
|
|
|
|
% if page <= 2 and max_pages > page + 3:
|
|
|
|
|
% for j in range(cluster - page):
|
|
|
|
|
<a href=/diary/{{page + j + 3}}>{{page + j + 3}}</a>
|
|
|
|
|
% end
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
% if page >= total - limit:
|
|
|
|
|
<a href=/diary/{{total -1}}>></a>
|
|
|
|
|
% if page >= max_pages:
|
|
|
|
|
<a href=/diary/{{max_pages}}>></a>
|
|
|
|
|
% else:
|
|
|
|
|
<a href=/diary/{{page + 1}}>></a>
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
<a href=/diary/{{total - 1}}>>></a>
|
|
|
|
|
<a href=/diary/{{max_pages}}>>></a>
|
|
|
|
|
</center>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|