-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
Simple pagination #1471
Merged
Merged
Simple pagination #1471
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prior to this, Alchemy would guess based on the screen size of the user. This deprecates the prior method which would rely on a session value only set in `alchemy-devise`.
This logic also does not work any longer since the removal of the screen-size-based pagination.
mamhoff
force-pushed
the
simple-pagination
branch
from
September 11, 2018 15:04
e431573
to
8192f77
Compare
tvdeyen
approved these changes
Sep 11, 2018
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.
This is great, thanks. This weird "feature" was flawed for a long time.
This never must have been in that form
@mamhoff I added a per page select that is persisted in cookies. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this pull request for?
This PR changes behaviour regarding the number of items per page in Alchemy admin controllers.
Prior to the PR, Alchemy would always return 25 items. If Alchemy-Devise was installed, that would set a
session[:screen_size]
value, the height of which was used to guess how many items fit on the screen.For some of my clients (with a screen height of 768), we sometimes got as little as three items, with no way to override it.
Notable changes (remove if none)
Alchemy::Admin::BaseController#per_page_value_for_screen_size
items_per_page
Alchemy::Admin::BaseController#items_per_page
?=per_page=25
to override paginationper
valueAdditional considerations
I thought about adding in a feature where users could choose the amount of items they prefer as a preference, however, I do not think that would work very well from a UI standpoint.
Besides, all the user logic is in Alchemy-Devise, so I actually think if we want that feature, we should add it there (and modify Alchemy's Base controller using some kind of extension mechanism).