Mercurial > piecrust2
comparison piecrust/data/paginator.py @ 298:b7ab1b503510
data: Fix incorrect next/previous page URLs in pagination data.
Consolidate splitting an URL between its first URL and its sub page number.
Be careful about the index page's URL not losing its slash.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 11 Mar 2015 23:46:42 -0700 |
parents | 9b75b49a4084 |
children | eb958151c8dc |
comparison
equal
deleted
inserted
replaced
297:2823ea40cfac | 298:b7ab1b503510 |
---|---|
210 return f | 210 return f |
211 | 211 |
212 def _getPageUri(self, index): | 212 def _getPageUri(self, index): |
213 uri = self._uri | 213 uri = self._uri |
214 if index > 1: | 214 if index > 1: |
215 if uri != '': | 215 if not uri.endswith('/'): |
216 uri += '/' | 216 uri += '/' |
217 uri += str(index) | 217 uri += str(index) |
218 return uri | 218 return uri |
219 | 219 |
220 def _onIteration(self): | 220 def _onIteration(self): |