print pagination links at the bottom of the page.
highlight the current page between []
This commit is contained in:
parent
7f104934ab
commit
9c4c948a7f
|
@ -451,12 +451,15 @@ if haveQuery:
|
||||||
|
|
||||||
# Pagination
|
# Pagination
|
||||||
if bans:
|
if bans:
|
||||||
print '<div style="clear: both">'
|
pagination = '<div style="clear: both">\n·\n'
|
||||||
print '·'
|
|
||||||
num_pages = int(math.ceil(ban_count / float(num_per_page)))
|
num_pages = int(math.ceil(ban_count / float(num_per_page)))
|
||||||
for i in range(num_pages):
|
for i in range(num_pages):
|
||||||
print '<a href="?%s">%d</a> ·' % (urlencode(page=i), i + 1)
|
if page == i:
|
||||||
print '</div>'
|
pagination += '<a href="?%s">[%d]</a> ·\n' % (urlencode(page=i), i + 1)
|
||||||
|
else:
|
||||||
|
pagination += '<a href="?%s">%d</a> ·\n' % (urlencode(page=i), i + 1)
|
||||||
|
pagination += '</div>\n'
|
||||||
|
print pagination
|
||||||
else:
|
else:
|
||||||
# nothign to show
|
# nothign to show
|
||||||
print '<div style="clear: both"></div>' # if I don't print this the page is messed up.
|
print '<div style="clear: both"></div>' # if I don't print this the page is messed up.
|
||||||
|
@ -556,6 +559,8 @@ for b in bans:
|
||||||
|
|
||||||
|
|
||||||
print '</table>'
|
print '</table>'
|
||||||
|
if bans:
|
||||||
|
print pagination
|
||||||
|
|
||||||
t2 = time.time()
|
t2 = time.time()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue