I've pulled in @dracos' commits from #139 on top of the latest v2 branch, and resolved merge conflicts, but I rewrote the commit that changes datasets.html.
Here's how it works this time. With JavaScript disabled:
It displays all categories and organisations
Categories and organisations have an accurate count next to them, but they're not sorted by that count (it's not possible without pretty hacky liquid soup)
It shows all datasets and hides the search input, like in the original PR
With JavaScript enabled, it hides the panels that list all categories and organisations, and populates a separate div. This reduces (but does not eliminate) jitter because the logic to hide it is executed very quickly on page load (swap the no-js class for js in the html element, and CSS takes it from there), whereas the logic to populate and sort the filter panel is done asynchronously after a JSON file is fetched. There still remains a jitter, but it should be exactly the same jitter that you'll already see in JKAN (demo.jkan.io/datasets).
We could go even further and add that plugin to sort it, but I reckon this gets us over the line, and we can always revisit the plugin after the GitHub Actions work is complete. What do you think?
I've pulled in @dracos' commits from #139 on top of the latest
v2
branch, and resolved merge conflicts, but I rewrote the commit that changesdatasets.html
.Here's how it works this time. With JavaScript disabled:
With JavaScript enabled, it hides the panels that list all categories and organisations, and populates a separate div. This reduces (but does not eliminate) jitter because the logic to hide it is executed very quickly on page load (swap the
no-js
class forjs
in thehtml
element, and CSS takes it from there), whereas the logic to populate and sort the filter panel is done asynchronously after a JSON file is fetched. There still remains a jitter, but it should be exactly the same jitter that you'll already see in JKAN (demo.jkan.io/datasets).We could go even further and add that plugin to sort it, but I reckon this gets us over the line, and we can always revisit the plugin after the GitHub Actions work is complete. What do you think?