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 tailwind pagination view #284

Merged
merged 2 commits into from
May 19, 2021
Merged

Conversation

bdelamatre
Copy link
Contributor

No description provided.

1) Eliminated the if block that wrapped the whole view because the view script should display its contents regardless of whether pagination is enabled or not. This is because it's also responsible for displaying the result count.

2) Fixed the links() logic to check $showPagination and not $showPerPage. Show Per Page's effect should be isolated to the per page select element, not whether the pagination links should be displayed.
@rappasoft
Copy link
Owner

What's the use case here? Also, the other templates would be unchanged but have the same issue as you are trying to fix. But I feel like we've gone back and forth with the wrapping if statement and I don't remember why haha.

@bdelamatre
Copy link
Contributor Author

The use case is that I have a table, with pagination, but I don't need to show the per-page dropdown. The current behavior is If showPerPage is false then pagination links are hidden.

I forget as well. I think the last time I touched it the goal was to display the result count regardless of whether pagination was enabled or not. This behavior was a little different on the tailwind theme since the bootstrap links() displayed the count reliably while tailwind didn't.

@rappasoft
Copy link
Owner

What about the $showPerPage property?

@bdelamatre
Copy link
Contributor Author

bdelamatre commented May 14, 2021 via email

@rappasoft
Copy link
Owner

What if we just changed it to:

@if ($showPagination)
    <div class="p-6 md:p-0">
        @if ($paginationEnabled && $rows->lastPage() > 1)
            {{ $rows->links() }}
        @else
            <p class="text-sm text-gray-700 leading-5">
                @lang('Showing')
                <span class="font-medium">{{ $rows->count() }}</span>
                @lang('results')
            </p>
        @endif
    </div>
@endif

@bdelamatre
Copy link
Contributor Author

Sure.

@rappasoft rappasoft added the Awaiting Next Release Currently merged into development awaiting a release to master label May 19, 2021
@rappasoft rappasoft mentioned this pull request May 19, 2021
@rappasoft rappasoft merged commit 4bbf22e into rappasoft:master May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants