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

Add page limit setting. #706

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Weyland
Copy link

@Weyland Weyland commented Mar 28, 2025

Introduce a page limit setting that is respected by all datatables.

Additionally fixed a Bootstrap grid layout thing.

Oh, and you can show All results in a table now. Something that would cause some load on the server, up to you if you want to keep it or not. I can remove it again.

<label class="col-md-6 col-form-label" for="page_limit">{{ trans('web::seat.page_limit') }}</label>
<div class="col-md-6">
<select id="page_limit" name="page_limit" class="form-control w-100">
@foreach([10, 25, 50, 100, -1] as $limit)
Copy link
Author

Choose a reason for hiding this comment

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

I could possibly pull this from the predefined profile settings? If so, could you let me know how? Saves me redefining it here is all.

Comment on lines +137 to +144

<script>
// Inject the page limit value with fallback to 10 if not set.
//
// This is required as `seat.js` uses this variable, with their own fallback, just in case.
var pageLength = {{ setting('page_limit') ?? 10 }};
</script>

Copy link
Author

Choose a reason for hiding this comment

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

Ideally I could have used this variable directly in seat.js but since it's not a blade template, that wasn't possible. I'd love to have another look and see if there is a better way to solve this. Could use some guidance on doing so but I think I can manage that.

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.

1 participant