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

Fix #13638: Utilize {% querystring %} template tag for pagination #13910

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BrendenBrahier
Copy link

Description

This pull request addresses issue #13638 by simplifying the querystring handling logic for pagination in weblate.trans.forms.SearchForm. The complex logic has been replaced by using the {% querystring %} template tag introduced in Django 5.1.

Changes Made

  • Commented out the items, urlencode, and reset_offset methods in SearchForm in weblate/trans/forms.py.
  • Updated the pagination links in weblate/templates/paginator.html to use the {% querystring %} template tag.
  • Ensured that the pagination links in weblate/templates/search.html include the updated paginator.html.

Testing

  • Verified that pagination works as expected.
  • Ensured that query parameters are preserved when navigating between pages.
  • Tested edge cases such as navigating to the first page, last page, and pages in between.

Additional Context

This change leverages the new {% querystring %} template tag introduced in Django 5.1, which simplifies the querystring handling logic and improves maintainability.

Checklist

  • Lint and unit tests pass.
  • Added tests that prove the fix is effective or that the new feature works.
  • Updated documentation to describe any new features or changed behavior.

Screenshots (if applicable)

N/A

Related Issues

Copy link
Member

@nijel nijel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also look at the test failures?

<li>
<a href="?{% querystring page=page_obj.next_page_number %}">Next &raquo;</a>
</li>
{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please bring back the original markup?

  • Page navigation is missing
  • UI icons are no longer used
  • RTL languages are no longer getting correct icons
  • Strings are no longer localized

data["checksum"] = ""
self.data = data
return self
# def items(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the code is no longer used, just remove it.

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 this pull request may close these issues.

Utilize {% querystring %} template tag
2 participants