From 5bd331dbbdce74a84885eb0912e548725bb2291d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Wed, 29 Apr 2020 15:45:44 +0000 Subject: [PATCH] Bug 25314: Make OPAC facets collapse TO TEST: 1. Apply patch 2. Regenerate CSS (yarn build --view opac) 3. DO a search and look at the facets. They should be collapsed. 4. Try mousing over a facet heading and click, that list should appear. 5. Try clicking the heading again to make th facet disappear. 6. Play around with different limiters and make sure eveything works. 7. Check aria labels look correct and you can tab through facets without a keyboard. --- koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss | 25 ++++++++++----- .../bootstrap/en/includes/opac-facets.inc | 36 ++++++++-------------- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 7 +++++ 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index 2fec169b94..618eb7691c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -2052,7 +2052,7 @@ input { a { background-color: #F0F3F3; border-bottom: 1px solid #D8D8D8; - display: block; + display: block; font-weight: bold; padding: .7em .2em; text-decoration: none; @@ -2071,13 +2071,6 @@ input { margin-bottom: 2px; padding: .1em .2em; } - - &.showmore { - a { - font-weight: bold; - text-indent: 1em; - } - } } a { @@ -2089,6 +2082,22 @@ input { display: inline-block; } + .toggle-facet { + cursor: pointer; + } + + .toggle-facet::before { + font-family: "FontAwesome"; + cursor: pointer; + content: '\f054'; + font-weight: 100; + font-size: 10px; + padding-right: 3px; + } + + .facet-list-expanded::before { + content: '\f078'; + } } #menu { diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index da5e98134e..6a2fb62168 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -21,20 +21,20 @@ [% FOREACH facets_loo IN facets_loop %] [% IF facets_loo.facets.size > 0 %]
  • - [% IF facets_loo.type_label_Authors %]
    Authors
    [% END %] - [% IF facets_loo.type_label_Titles %]
    Titles
    [% END %] - [% IF facets_loo.type_label_Topics %]
    Topics
    [% END %] - [% IF facets_loo.type_label_Places %]
    Places
    [% END %] - [% IF facets_loo.type_label_Series %]
    Series
    [% END %] - [% IF facets_loo.type_label_ItemTypes %]
    Item types
    [% END %] - [% IF facets_loo.type_label_CollectionCodes %]
    Collections
    [% END %] - [% IF facets_loo.type_label_Language %]
    Languages
    [% END %] + [% IF facets_loo.type_label_Authors %][% END %] + [% IF facets_loo.type_label_Titles %][% END %] + [% IF facets_loo.type_label_Topics %][% END %] + [% IF facets_loo.type_label_Places %][% END %] + [% IF facets_loo.type_label_Series %][% END %] + [% IF facets_loo.type_label_ItemTypes %][% END %] + [% IF facets_loo.type_label_CollectionCodes %][% END %] + [% IF facets_loo.type_label_Language %][% END %] [% UNLESS singleBranchMode %] - [% IF ( facets_loo.type_label_HomeLibrary ) %]
    Home libraries
    [% END %] - [% IF ( facets_loo.type_label_HoldingLibrary ) %]
    Holding libraries
    [% END %] + [% IF ( facets_loo.type_label_HomeLibrary ) %][% END %] + [% IF ( facets_loo.type_label_HoldingLibrary ) %][% END %] [% END %] - [% IF facets_loo.type_label_Location %]
    Locations
    [% END %] -