Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Adapt template block pagination.next, when using lazy pagination #698

Closed
tuky opened this issue Oct 10, 2019 · 4 comments · Fixed by #707
Closed

Feature request: Adapt template block pagination.next, when using lazy pagination #698

tuky opened this issue Oct 10, 2019 · 4 comments · Fixed by #707

Comments

@tuky
Copy link
Contributor

tuky commented Oct 10, 2019

Currently, we are using this template extension, when configuring the lazy paginator:

{% extends "django_tables2/bootstrap4.html" %}

{% block pagination.next %}
    <li class="page-item"><a class="page-link">...</a></li>
    {{ block.super }}
{% endblock pagination.next %}

It improves communicating to the user visually, that there may be many more pages:
page
Do you think this could be added to the upstream templates?

@jieter
Copy link
Owner

jieter commented Oct 21, 2019

I think you should amend the table_page_range filter to emit another instance of '...' at the end of the range when using a LazyPaginator, because by changing the template you won't be able to distinguish between cases using LazyPaginator or not.

@tuky
Copy link
Contributor Author

tuky commented Oct 21, 2019

you mean to add something like

if isinstance(paginator, LazyPaginator):
    ret.append("...")

to the end of table_page_range?

@jieter
Copy link
Owner

jieter commented Oct 21, 2019

Yes

@tuky
Copy link
Contributor Author

tuky commented Oct 21, 2019

great, i will try to come up with a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants