This patch implements collapsing facets using the Bootstrap Collapse
component.
To test, apply the patch and rebuild the OPAC CSS.
1. Clear your browser cache if necessary.
2. Using the sample data, go to Advanced Search in the OPAC. Check the
"Books" checkbox under the "Item types" tab and submit.
3. In the left-hand sidebar you should see the facets you normally see,
but now each one has an arrow icon to show whether the facet is
expanded or collapsed.
4. All facets should be expanded by default. Adding expanded/collapsed
settings to system preferences is out of scope for this bug.
5. Test expanding and collapsing facets, as well as the "Show more" link
under each one.
6. Click the "Fiction" link under the "Collections" facet. When the
refined search results load you clicked should now have a red "X"
link next to "Fiction," which should no longer be a link.
- Because "Fiction" is the only uption under the "Collections" facet,
the facet is not collapsible. I reasoned that it would be important
not to let a facet limitation disappear behind hidden facets.
* The only way I know to do this in the template is to check for
facets with only one option this has the possibly-unwanted side
effect of making facets which haven't been selected but still only
have one option not collapsible. In this example search "Holding
libraries" and "Topics" show this. I'm open to suggestions on this!
7. Test with the displayFacetCount preference both enabled and disabled.
Sponsored-by: Athens County Public Libraries
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 2546c08688)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>