first link appears when it's out of -3,+3 range of current page
This commit is contained in:
+6
-3
@@ -4,13 +4,16 @@
|
|||||||
<div class="diary-dir">
|
<div class="diary-dir">
|
||||||
|
|
||||||
<%
|
<%
|
||||||
if page < 0:
|
if page <= 0:
|
||||||
page = 0
|
page = 0
|
||||||
end
|
end
|
||||||
if page > total - 1:
|
if page > int(total - 1 / limit):
|
||||||
page = total - 1
|
page = int(total - 1 / limit)
|
||||||
end
|
end
|
||||||
%>
|
%>
|
||||||
|
% if page >= limit + 1:
|
||||||
|
<a href=0>first</a>
|
||||||
|
% end
|
||||||
% for i in range(max(0,page - limit), min(total,page + limit)):
|
% for i in range(max(0,page - limit), min(total,page + limit)):
|
||||||
% if i == page:
|
% if i == page:
|
||||||
<b>{{i}}</b>
|
<b>{{i}}</b>
|
||||||
|
|||||||
Reference in New Issue
Block a user