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

CB-406: Extract pagination logic into common component #390

Merged
merged 11 commits into from
Feb 6, 2022

Conversation

anshg1214
Copy link
Member

CB-406

  • Extracted pagination into macros
  • Improved pagination for easy navigation

Copy link
Member

@amCap1712 amCap1712 left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for working on this and apologies for the late review.

The new pagination code is different from what we used originally. It looks like it allows to paginate among 5 pages at a time. I guess this way is probably fine too but any particular reason you chose to implement it this way instead of the existing previous and next buttons?

@anshg1214
Copy link
Member Author

I chose to paginate 5 pages at a time because I felt that it is much better for easy navigation compared to the existing previous and next buttons. Also, I chose to paginate 5 pages mainly because it provides the best use. A smaller number would not add much utility, and any number greater than 5 would be too much for the user to navigate.

Copy link
Member

@amCap1712 amCap1712 left a comment

Choose a reason for hiding this comment

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

Thanks for the updates. A few more changes and we should be good to go!

@anshg1214 anshg1214 requested a review from amCap1712 February 6, 2022 17:49
Copy link
Member

@amCap1712 amCap1712 left a comment

Choose a reason for hiding this comment

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

Thanks!

@amCap1712 amCap1712 merged commit 95e559c into metabrainz:master Feb 6, 2022
@github-actions
Copy link

github-actions bot commented Feb 6, 2022

Unit Test Results

    1 files  ±0      1 suites  ±0   51s ⏱️ ±0s
145 tests ±0  145 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 95e559c. ± Comparison against base commit 95e559c.

<nav aria-label="Page navigation">
<ul class="pagination">

<li class="previous {{'disabled' if current_page <= 1 }}"><a aria-label="Previous" href="{{ url_for(page_info, page=page-1, **parameter) }}">&larr; {{ _('Previous') }}</a></li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

the aria-label should probably also be translated

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.

4 participants