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

Altering the order of first/previous and last/next #83

Open
JohnKacz opened this issue Feb 4, 2019 · 5 comments
Open

Altering the order of first/previous and last/next #83

JohnKacz opened this issue Feb 4, 2019 · 5 comments

Comments

@JohnKacz
Copy link

JohnKacz commented Feb 4, 2019

If I wanted to do something like this

<%= pagination_links @conn, @page, distance: 2, first: "<<", previous: "<", next: ">", last: ">>", ellipsis: false %>

it would generate

< << 5 6 7 8 9 >> >

but I would want to generate

<< < 5 6 7 8 9 > >>

Another enhancement that I don't think is currently possible is always showing the previous/next buttons but mark them as disabled if on the first/last page respectively.

@mgwidmann
Copy link
Owner

Ah hmmm yeah, thats not configurable. How would you suggest making that configurable? I'm not sure if we should introduce an order tuple or not, something like {:previous, :first, :pages, :last, :next}?

@mendomedia
Copy link

What about a param something like <%= pagination_links @page, distance: 1, edge: "outside" %> meaning that the "edge" page elements (first and last) would be forced to the outside positions as requested above. Default would be edge: "inside".

@mgwidmann
Copy link
Owner

I'm not sure that edge is quite clear enough. I'd like something more descriptive but theres nothing that immediately jumps to my mind...

@JohnKacz
Copy link
Author

boundary or border?

@mgwidmann
Copy link
Owner

mgwidmann commented Jul 22, 2019

I think something like first_last_links: :outside or first_last_links: :inside would be ok. Thats clear and self-explanatory.

Though I still don't see why an order tuple wouldn't also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants