Empty pages and the calendar extra #713
-
I am using the calendar extra for a collection of items which range over about 10 years. Some months contain no items. Should I be able to see that in the styling for the empty months, so the user can jump straight to months with items and not have to click through lots of empty months. Or perhaps not even show the empty months? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 27 replies
-
It's currently not possible to skip months or any other empty units from the calendar bar, and it would be a quite messy looking bar. One cool feature that I contemplated to implement would be the possibility to disable the links to the empty unit pages, but it looks quite a challenge ATM. If you can think of an efficient way to do it we could work on it. |
Beta Was this translation helpful? Give feedback.
-
Yes, that's one way of doing it. Or you can just use the HTML markup that pagy already uses for disabled links also for empty pages, with the added benefit that they will not be clickable anymore, and eventual readers will be aware of it. I mean, modify the %(<a role="link" aria-disabled="true">#{pagy.label_for(item)}</a>) |
Beta Was this translation helpful? Give feedback.
-
@rogermarlow I've got a bit of time so I started a calendar branch. I just converted the calendar playground app to a minimal rails app, which use sqlite instead of a mock collection: it will help using |
Beta Was this translation helpful? Give feedback.
-
@rogermarlow You can try the calendar branch. Missing docs, tests and some stylesheet to target the |
Beta Was this translation helpful? Give feedback.
-
About the sqlite restriction: it looks like it has been stuck there for 5 years and counting! |
Beta Was this translation helpful? Give feedback.
-
Ruby and e2e tests pass! 🎉 |
Beta Was this translation helpful? Give feedback.
-
The optional empty pages feature has been implemented in v8.5 |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm paginating data using years and months. Some months have entries, some don't. The empty pages features works fine and I can hide the months, however if e.g. 2023-12 was an empty month, I still get that when I click 2023 (I'm using reverse order). How do I make it instead completely ignore these months and if 2023-11 was the first non-empty page in 2023, show that by default when I click on 2023? |
Beta Was this translation helpful? Give feedback.
The optional empty pages feature has been implemented in v8.5