-
Notifications
You must be signed in to change notification settings - Fork 525
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
AO3-6880 Use pagy gem for pagination on select pages #5054
base: master
Are you sure you want to change the base?
Conversation
Supposedly, the Brakeman warnings should be ignored. Not sure if/how I can tell Github Actions to ignore them on my side (our doc only refers to the local ignore file) |
... Most of the time
rescue Pagy::OverflowError | ||
nil | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping the same behavior as now by not showing the pagination in case of overflow ("page 66 of 10").
pagy's alternative options for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not setting Pagy::DEFAULT[:overflow]
, the default is :empty_page
instead of :exception
, do we need to wrap calls in pagy_overflow_handler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the require 'pagy/extras/overflow'
line, Pagy always raises an exception in case of overflow (source)
You can add We stopped keeping the ignore file in the repo since #4158. I'll update the wiki. |
rescue Pagy::OverflowError | ||
nil | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're not setting Pagy::DEFAULT[:overflow]
, the default is :empty_page
instead of :exception
, do we need to wrap calls in pagy_overflow_handler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Pull Request Checklist
AO3-1234 Fix thing
)Issue
https://otwarchive.atlassian.net/browse/AO3-6880
Purpose
As per ticket.
Visible (frontend) differences from will_paginate:
rel="prev"
andrel="next"
have disappeared but seem to be obsolete anyway (cf https://developers.google.com/search/docs/specialty/ecommerce/pagination-and-incremental-page-loading)title
attributes (all equal to an untranslated "pagination" string) have not made the cut<li>
tags have been removed. In other words, the HTML was previously</li> <li>
and is now</li><li>
. This means the pagination is slightly more compact looking. Maybe need to add back some padding in CSS?1 2 ... <> ... 312 313
) while pagy only shows the very first and the last (1 ... <> ... 313
). There doesn't seem to be an option to modify that behavior without going into the code (cf Pagy#series). Unsure if worth it.Before/after pictures:
![will_paginate](https://private-user-images.githubusercontent.com/896729/410778524-9a670d44-eaf7-4fba-8082-a467e6191ac9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODQyODUsIm5iZiI6MTczOTM4Mzk4NSwicGF0aCI6Ii84OTY3MjkvNDEwNzc4NTI0LTlhNjcwZDQ0LWVhZjctNGZiYS04MDgyLWE0NjdlNjE5MWFjOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQxODEzMDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xYzRkODEzMWI0YjU5MTJlOWExYTE4ZjBmNWIwMzYxYTM0ZjVhMTU5M2YxYjVjYTZiNmEwN2VkMTc3ZmQ1MTczJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.fSJiCzRzukFwklwBTCK7rbJF3w-2aMYXJTL-fYeFIBc)
![pagy](https://private-user-images.githubusercontent.com/896729/410778556-0dec522f-9e11-43f3-855d-da3adab97d8c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzODQyODUsIm5iZiI6MTczOTM4Mzk4NSwicGF0aCI6Ii84OTY3MjkvNDEwNzc4NTU2LTBkZWM1MjJmLTllMTEtNDNmMy04NTVkLWRhM2FkYWI5N2Q4Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQxODEzMDVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zOTI1NGZjYzY0Y2RiNWI0Y2I2MDZlMTUzZWQ3MGNiZGY0YzU2MWZmOTM5ZDM5MGU5ZTU4NTgzNWI0Yjg3ZTM0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.V3amoY_TwDmtJZQ7VtZ_OIdhG2U2ps2YxJHi8bPVAMY)
Testing Instructions
In theory, everything should be working as before on the three modified pages, except for the minor changes listed above.
Credit
Ceithir (he/him)