jmcclell / django-bootstrap-pagination

Django template tag for rendering Page objects as Bootstrap pagination HTML
MIT License
212 stars 83 forks source link

Bug in pagination (first and last links) #12

Closed bastiao closed 11 years ago

bastiao commented 11 years ago

Fixed bug with First page and last page. Only one appears with the correct link. The other pages appear with the default link.

Let me know if you have any doubt.

jmcclell commented 11 years ago

I wish I could remember my original intent. I believe, though it has been quite some time, that I originally intended to be smart about the links such that I wouldn't show a previous link if you were on the first page, a next link if you were on the last page, etc.

In this case, maybe I decided that since they are already on the first page there is no point in having this link? I'm not sure. Either way, given this fix, you can actually remove the conditional all together since the page number will always be >= 1 or <= max pages.

bastiao commented 11 years ago

Thanks for your reply.

Redundancy of links is acceptable, for me. But one of the links pointing to out of the results is negative in my opinion.

bastiao commented 11 years ago

For instance, if you only have a page of results, it will 3 buttons:

[<<] [1] [>>]

Two of them are pointing out to "#"

jmcclell commented 11 years ago

That makes sense. I'll merge your fix.