|
|
|
@ -28,6 +28,13 @@
|
|
|
|
|
<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(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
|
|
|
|
|
% for i in range(max(0,page - cluster), min(max_pages + 1,page + cluster + 1)):
|
|
|
|
|
% # bold current page number
|
|
|
|
@ -40,9 +47,9 @@
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
% # 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):
|
|
|
|
|
<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
|
|
|
|
|
|
|
|
|
|