jmcclell / django-bootstrap-pagination

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

show_index_range option #42

Closed richardbrockie closed 8 years ago

richardbrockie commented 8 years ago

Hi, The paginator by default displays the page numbers: [1, 2, 3, 4, 5, etc.]

If I have 50 items per page, I have a need to display instead: [1-50, 51-100, 101-150, 151-200, 201-250, etc.].

The index_range is determined for each page and included in page_urls. I've added the parameter 'show_index_range' defaulting to 'false'. If true, the index_range is displayed by the template instead of pagenum.

I've retained the pagenum test in the template to ensure the active class is correctly applied.

jmcclell commented 8 years ago

Thanks!