Skip to content
Snippets Groups Projects
Commit 0b0fd3e3 authored by Gregor Gawol's avatar Gregor Gawol Committed by Robert Lange
Browse files

refs #20465 [fid_adlr] sidefacets as structured list ul/li

* set text hover
* set remove-filter color
* remove span filter list value
parent 54dddcf5
No related merge requests found
......@@ -2060,6 +2060,10 @@ input.searchForm_lookfor {
border-bottom: 2px solid $violet;
}
.remove-filter {
color: $violet;
}
.date-fields {
label {
font-family: $font-family-monospace;
......@@ -2083,6 +2087,10 @@ input.searchForm_lookfor {
> span {
display: inline-block;
}
&:hover {
color: $azure;
}
}
}
......
......@@ -62,7 +62,7 @@ if ($hierarchicalFacets) {
<button class="title<?php if(in_array($title, $collapsedFacets)): ?> collapsed<?php endif ?>" data-toggle="collapse" href="#side-collapse-<?=$this->escapeHtmlAttr($title) ?>" >
<?=$this->transEsc($cluster['label'])?>
</button>
<div id="side-collapse-<?=$this->escapeHtmlAttr($title)?>" class="collapse<?php if (!in_array($title, $collapsedFacets)): ?> in<?php endif ?>">
<ul id="side-collapse-<?=$this->escapeHtmlAttr($title)?>" class="collapse<?php if (!in_array($title, $collapsedFacets)): ?> in<?php endif ?>">
<?=$this->context($this)->renderInContext(
'Recommend/SideFacets/facet.phtml',
[
......@@ -70,7 +70,7 @@ if ($hierarchicalFacets) {
'cluster' => $cluster,
'collapsedFacets' => $collapsedFacets ]
); ?>
</div>
</ul>
</div>
<?php endforeach; ?>
<?php endif; ?>
......
<!-- fid_adlr: Recommend - SideFacets - filter-list -->
<div class="facet-group active-filters flex-column-reverse">
<span class="flex-column-default">
<?php $filterCount = 0; ?>
<?php foreach ($filterList as $field => $filters): ?>
<?php foreach ($filters as $i => $filter): ?>
<?php
$filterCount++;
$index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false;
if ($index !== false) {
unset($collapsedFacets[$index]); // Open if we have a match
}
if (!isset($removeAllLinkQuery)) {
$removeAllLinkQuery = $results->getUrlQuery();
}
if (isset($filter['specialType']) && $filter['specialType'] == 'keyword') {
$removeLink = $this->currentPath() . $results->getUrlQuery()->replaceTerm($filter['value'], '');
$removeAllLinkQuery = $removeAllLinkQuery->replaceTerm($filter['value'], '');
} else {
$removeLink = $this->currentPath() . $results->getUrlQuery()->removeFacet($filter['field'], $filter['value'], $filter['operator']);
$removeAllLinkQuery = $removeAllLinkQuery->removeFacet($filter['field'], $filter['value'], $filter['operator']);
}
if ($filter['displayText'] == '[* TO *]') {
$filter['displayText'] = $this->translate('filter_wildcard');
}
?>
<a class="facet" href="<?=$removeLink ?>" title="<?=$this->transEsc('clear_tag_filter') ?>">
<span class="text">
<ul>
<?php $filterCount = 0; ?>
<?php foreach ($filterList as $field => $filters): ?>
<?php foreach ($filters as $i => $filter): ?>
<?php
$filterCount++;
$index = isset($filter['field']) ? array_search($filter['field'], $collapsedFacets) : false;
if ($index !== false) {
unset($collapsedFacets[$index]); // Open if we have a match
}
if (!isset($removeAllLinkQuery)) {
$removeAllLinkQuery = $results->getUrlQuery();
}
if (isset($filter['specialType']) && $filter['specialType'] == 'keyword') {
$removeLink = $this->currentPath() . $results->getUrlQuery()->replaceTerm($filter['value'], '');
$removeAllLinkQuery = $removeAllLinkQuery->replaceTerm($filter['value'], '');
} else {
$removeLink = $this->currentPath() . $results->getUrlQuery()->removeFacet($filter['field'], $filter['value'], $filter['operator']);
$removeAllLinkQuery = $removeAllLinkQuery->removeFacet($filter['field'], $filter['value'], $filter['operator']);
}
if ($filter['displayText'] == '[* TO *]') {
$filter['displayText'] = $this->translate('filter_wildcard');
}
?>
<li class="facet">
<a class="remove-filter" href="<?=$removeLink ?>" title="<?=$this->transEsc('clear_tag_filter') ?>">
<span class="sr-only"><?=$this->transEsc('clear_tag_filter') ?></span>
<span class="text">
<i class="icon icon-close" aria-hidden="true"></i>&nbsp;
<?php if ($filter['operator'] == 'NOT'): ?><?=$this->transEsc('NOT') ?><?php endif; ?>
<?php if ($filter['operator'] == 'OR' && $i > 0): ?><?=$this->transEsc('OR') ?><?php endif; ?>
<?=$this->transEsc($field) ?>: <?=$this->escapeHtml($filter['displayText']) ?>
</span>
<?php /* fid_adlr: Move icon refs #15646 - GG */ ?>
<?php /* */ ?>
</a>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ($filter['operator'] == 'OR' && $i > 0): ?><?=$this->transEsc('OR') ?><?php endif; ?>
<?=$this->transEsc($field) ?>: <?=$this->escapeHtml($filter['displayText']) ?>
</span>
<?php /* fid_adlr: Move icon refs #15646 - GG */ ?>
<?php /* */ ?>
</a>
</li>
<?php endforeach; ?>
<?php endforeach; ?>
</ul>
</span>
<?php if ($filterCount > 1 && !empty($removeAllLinkQuery)): ?>
<a class="facet all-filters" href="<?= $this->currentPath() . $removeAllLinkQuery ?>" title="<?= $this->transEsc('clear_tag_filter_all') ?>">
<a class="facet all-filters" href="<?= $this->currentPath() . $removeAllLinkQuery ?>" title="<?= $this->transEsc('clear_tag_filter_all') ?>">
<span class="text">
<i class="icon icon-trash-2" aria-hidden="true"></i>&nbsp;
<?= $this->transEsc('clear_tag_filter_all') ?>
</span>
</a>
<?php endif; ?>
</a>
<?php endif; ?>
</div>
<!-- fid_adlr: Recommend - SideFacets - filter-list - END -->
\ No newline at end of file
<!-- fid_adlr - Recommend - SideFacets - single-facet -->
<?php
$toggleUrl = $this->facet['isApplied']
? $this->urlBase . $this->url->removeFacet($this->group, $this->facet['value'], $this->facet['operator'])
......@@ -20,6 +21,9 @@
$displayText = $this->escapeHtml($this->facet['value']);
}
// #18509 decorate special untranslated terms with language tags
$displayText = $this->sideFacet()->getLanguageTag($displayText, 'span', $this->layout()->userLang);
if ($this->facet['operator'] == 'OR') {
$displayText =
'<i class="icon ' . ($this->facet['isApplied'] ? 'icon-check' : 'icon-square') . '" aria-hidden="true"></i> '
......@@ -30,11 +34,24 @@
<?php if ($hasSubLinks): ?>
<li 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>
<li>
<a
<?php if ($this->facet['isApplied']): ?>id="<?=$this->sideFacet()->setAppliedFacet($this->transEsc('Skip to facet', ['%%filter_name%%' => $this->facet['displayText']])) ?>"<?php endif; ?>
href="<?=$toggleUrl ?>"
class="<?=implode(' ', $classList) ?>"
data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>"
data-count="<?=$this->facet['count'] ?>"
title="<?php if($this->facet['isApplied']): ?><?=$this->transEsc('applied_filter')?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $this->facet['displayText']])?><?php else: ?><?=$this->transEsc('page_reload_on_select_hint', ['%%filter_name%%' => $this->facet['displayText']])?><?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;?>>
<a class="text"
href="<?=$toggleUrl ?>"
data-lightbox-ignore
data-title="<?=$this->escapeHtmlAttr($this->facet['displayText']) ?>"
data-count="<?=$this->facet['count'] ?>"
title="<?php if($this->facet['isApplied']): ?><?=$this->transEsc('applied_filter')?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $this->facet['displayText']])?> <?=$this->escapeHtmlAttr($this->facet['displayText']) ?><?php else: ?><?=$this->transEsc('page_reload_on_select_hint', ['%%filter_name%%' => $this->facet['displayText']])?><?php endif;?>">
<?=$displayText ?>
</a>
<?php else: ?>
......@@ -45,13 +62,16 @@
<?/* php if (!$this->facet['isApplied']): ?>
<span class="badge">
<?=$this->localizedNumber($this->facet['count']) ?>
<?=$this->localizedNumber($this->facet['count']) ?><span class="sr-only"><?=$this->transEsc('results') ?></span>
</span>
<?php endif;*/ ?>
<?php if ($this->exclude && !$this->facet['isApplied']): ?>
<?php if ($hasSubLinks): ?>
<?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="icon icon-minus-circle" aria-hidden="true"></i></a>
<a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude" title="<?= $this->transEsc('exclude_filter', ['%%filter_name%%' => $this->facet['displayText']]) ?>, <?= $this->transEsc('page_reload_hint') ?>">
<i class="fa fa-times" aria-hidden="true"></i>
</a>
<?php endif; ?>
<?=$hasSubLinks ? '</li>' : '</a>'; ?>
<?=$hasSubLinks ? '</li>' : '</a></li>'; ?>
<!-- fid_adlr - Recommend - SideFacets - single-facet - END -->
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment