some fixes in backoffice listing

This commit is contained in:
Thomas NOËL 2012-09-05 10:44:58 +02:00
parent 31cbfce2fe
commit 54e6bc9b72
1 changed files with 6 additions and 3 deletions

View File

@ -35,7 +35,7 @@ class FormDefUI:
if offset and not count:
count = 20
items, total_count = self.get_listing_items(selected_filter, offset, count)
if offset > 0 or total_count > count:
if (offset > 0) or (total_count > count > 0):
partial_display = True
if not partial_display:
@ -105,9 +105,10 @@ class FormDefUI:
query['offset'] = max(offset-count, 0)
query['count'] = count
'<a href="?%s">%s</a>' % (urllib.urlencode(query), _('Previous Page'))
else:
_('Previous Page')
if offset + count < total_count:
' - '
' - '
if offset + count < total_count:
# link to next page
@ -115,6 +116,8 @@ class FormDefUI:
query['offset'] = offset+count
query['count'] = count
'<a href="?%s">%s</a>' % (urllib.urlencode(query), _('Next Page'))
else:
_('Next Page')
'</div>'
def get_listing_items(self, selected_filter='all', offset=None, count=None):