diff --git a/views.py b/views.py index 3b83955eb5ce2e3b5d86b149b20657d919ac6377_dmlld3MucHk=..29352cef74aef61553ce6eaf6d605ce3b7608d2f_dmlld3MucHk= 100644 --- a/views.py +++ b/views.py @@ -160,10 +160,10 @@ ''' Pagination HTML generation ''' - if response.hits.total < 10: + if response.hits.total <= 10: return url_params = self._cw.form.copy() with t.ul(self.w, klass="pagination") as ul: current_page = int(url_params.get('page', 1)) url_params['page'] = current_page - 1 if current_page - 1 >= 1: @@ -164,10 +164,10 @@ return url_params = self._cw.form.copy() with t.ul(self.w, klass="pagination") as ul: current_page = int(url_params.get('page', 1)) url_params['page'] = current_page - 1 if current_page - 1 >= 1: - ul(t.li(t.a('>' * 3, + ul(t.li(t.a('<' * 3, href=self._cw.build_url(**url_params)))) else: ul(t.li(t.a('<' * 3))) @@ -171,7 +171,7 @@ href=self._cw.build_url(**url_params)))) else: ul(t.li(t.a('<' * 3))) - total_pages = response.hits.total / 10 + total_pages = (response.hits.total / 10) + 2 page_padding = 3 if current_page > page_padding: @@ -194,7 +194,7 @@ url_params['page'] = current_page + 1 if current_page + 1 >= (total_pages): - ul(t.li(t.a('<' * 3))) + ul(t.li(t.a('>' * 3))) else: ul(t.li(t.a('>' * 3, href=self._cw.build_url(**url_params))))