From f1a28ea75d44531191e3e27c1feb025e57a3aa14 Mon Sep 17 00:00:00 2001 From: "kazzer@ub.uni-leipzig.de" <kazzer@ub.uni-leipzig.de> Date: Thu, 5 Mar 2020 16:20:34 +0100 Subject: [PATCH] refs #16896 [master-v5] * corrects sidebar borders * fixes facet html code from incorrect uncontained li to div --- themes/finc/scss/compiled.scss | 4 +- .../Recommend/SideFacets/single-facet.phtml | 58 +++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 themes/finc/templates/Recommend/SideFacets/single-facet.phtml diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 85d114abe07..5b48c8843c9 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1941,9 +1941,7 @@ footer { //// Style my account sidebar menues to get the same look as facets .myresearch-menu { - border-bottom: 1px solid $border-color; - border-left: 1px solid $border-color; - border-top: 1px solid $border-color; + border: 1px solid $border-color; a:not(:last-of-type) { border-bottom: 1px solid $border-color; diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml new file mode 100644 index 00000000000..6f6bb7f0bb9 --- /dev/null +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -0,0 +1,58 @@ +<!-- finc - Recommend - SideFacets - single-facet --> +<?php + $toggleUrl = $this->facet['isApplied'] + ? $this->urlBase . $this->url->removeFacet($this->group, $this->facet['value'], $this->facet['operator']) + : $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], $this->facet['operator']); + + $hasSubLinks = $this->exclude && !$this->facet['isApplied']; + + $classList = ['facet', 'js-facet-item']; + if (!empty($this->moreClass)) { + $classList[] = $this->moreClass; + } + if ($this->facet['isApplied']) { + $classList[] = 'active'; + } + + $displayText = '-'; + if (!empty($this->facet['displayText'])) { + $displayText = $this->escapeHtml($this->facet['displayText']); + } elseif (!empty($this->facet['value'])) { + $displayText = $this->escapeHtml($this->facet['value']); + } + + if ($this->facet['operator'] == 'OR') { + $displayText = + '<i class="fa ' . ($this->facet['isApplied'] ? 'fa-check-square-o' : 'fa-square-o') . '" aria-hidden="true"></i> ' + . $displayText; + } +?> +<?php if ($hasSubLinks): ?> + <div class="<?=implode(' ', $classList) ?>"> +<?php else: ?> + <a href="<?=$toggleUrl ?>" class="<?=implode(' ', $classList) ?>" data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEsc('applied_filter') ?>"<?php endif;?> data-lightbox-ignore> +<?php endif; ?> + + <?php if ($hasSubLinks): ?> + <a class="text" href="<?=$toggleUrl ?>" data-lightbox-ignore data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>" data-count="<?=$this->facet['count'] ?>"<?php if($this->facet['isApplied']): ?> title="<?=$this->transEsc('applied_filter') ?>"<?php endif;?>> + <?=$displayText ?> + </a> + <?php else: ?> + <span class="text"> + <?=$displayText ?> + </span> + <?php endif; ?> + + <?php if (!$this->facet['isApplied']): ?> + <span class="badge"> + <?=$this->localizedNumber($this->facet['count']) ?> + </span> + <?php endif; ?> + + <?php if ($this->exclude && !$this->facet['isApplied']): ?> + <?php $excludeURL = $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], 'NOT'); ?> + <a href="<?=$excludeURL ?>" data-lightbox-ignore title="<?=$this->transEsc('exclude_facet') ?>" class="exclude"><i class="fa fa-times" aria-hidden="true"></i></a> + <?php endif; ?> + +<?=$hasSubLinks ? '</div>' : '</a>'; ?> +<!-- finc - Recommend - SideFacets - single-facet - END --> \ No newline at end of file -- GitLab