|
|
@ -28,6 +28,13 @@
|
|
|
|
<a href=/diary/{{page - 1}}><</a>
|
|
|
|
<a href=/diary/{{page - 1}}><</a>
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
% # fill out number cluster to the left when page is high
|
|
|
|
|
|
|
|
% if page >= max_pages - cluster:
|
|
|
|
|
|
|
|
% for j in range(page - cluster):
|
|
|
|
|
|
|
|
<a href=/diary/{{page + j + cluster + 1}}><b>{{page + j + cluster + 1}}</b></a>
|
|
|
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
|
|
% # form cluster of number links around page
|
|
|
|
% # form cluster of number links around page
|
|
|
|
% for i in range(max(0,page - cluster), min(max_pages + 1,page + cluster + 1)):
|
|
|
|
% for i in range(max(0,page - cluster), min(max_pages + 1,page + cluster + 1)):
|
|
|
|
% # bold current page number
|
|
|
|
% # bold current page number
|
|
|
@ -40,9 +47,9 @@
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
|
|
% # fill out number cluster to the right when page is low
|
|
|
|
% # fill out number cluster to the right when page is low
|
|
|
|
% if page <= 2 and max_pages > page + 3:
|
|
|
|
% if page <= cluster - 1 and max_pages > page + cluster:
|
|
|
|
% for j in range(cluster - page):
|
|
|
|
% for j in range(cluster - page):
|
|
|
|
<a href=/diary/{{page + j + cluster + 1}}><b>{{page + j + cluster + 1}}</b></a>
|
|
|
|
<a href=/diary/{{page + j + cluster + 1}}>{{page + j + cluster + 1}}</a>
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
|
|