nav length never dips below 7 (+ cluster of 3 on both sides of current page) when page number is low

small-nav
chimchooree 4 years ago
parent b432b674fe
commit 4c3a9a2b52

@ -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

Loading…
Cancel
Save