Skip to content

Commit

Permalink
Merge branch 'release-10.1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Nov 7, 2024
2 parents e92629f + d62c062 commit ce0a1f6
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1202,12 +1202,12 @@ public function testCheckboxFacets(bool $deferred, bool $counts): void
$filter = $this->findCss($page, '.checkbox-filter');
$this->assertNotNull($filter);
$this->assertEquals('Books', $this->findCssAndGetText($filter->getParent(), '.icon-link__label'));
$this->assertEquals($counts ? '9' : '', $this->findCssAndGetText($filter, '.avail-count'));
$this->assertEquals($counts ? '9' : '', $this->findCssAndGetText($filter->getParent(), '.avail-count'));

// illustrated:Illustrated is only a checkbox facet:
$filter2 = $this->findCss($page, '.checkbox-filter', null, 1);
$this->assertNotNull($filter2);
$this->assertEquals('Illustrated', $this->findCssAndGetText($filter2, '.icon-link__label'));
$this->assertEquals('Illustrated', $this->findCssAndGetText($filter2->getParent(), '.icon-link__label'));
$illustratedCount = $this->findCssAndGetText($filter2->getParent(), '.avail-count');
$this->assertEquals($counts ? '2' : '', $illustratedCount);

Expand Down
4 changes: 2 additions & 2 deletions themes/bootstrap3/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ VuFind.register('sideFacets', function SideFacets() {
function activateSingleAjaxFacetContainer() {
var $container = $(this);
var facetList = [];
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkbox-filter[data-facet]');
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkboxFilter [data-facet]');
$facets.each(function addFacet() {
if (!$(this).data('loaded')) {
facetList.push($(this).data('facet'));
Expand Down Expand Up @@ -493,7 +493,7 @@ VuFind.register('sideFacets', function SideFacets() {
.done(function onGetSideFacetsDone(response) {
$.each(response.data.facets, function initFacet(facet, facetData) {
var containerSelector = typeof facetData.checkboxCount !== 'undefined'
? '.checkbox-filter' : ':not(.checkbox-filter)';
? '.checkboxFilter ' : '.facet-group ';
var $facetContainer = $container.find(containerSelector + '[data-facet="' + facet + '"]');
$facetContainer.data('loaded', 'true');
if (typeof facetData.checkboxCount !== 'undefined') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
? $results->getUrlQuery()->removeFilter($current['filter'])
: $results->getUrlQuery()->addFilter($current['filter']);
?>
<div class="facet" >
<a class="checkbox-filter icon-link<?=$isHidden ? ' hidden' : '' ?>" href="<?=$href ?>" data-facet="<?=$this->escapeHtmlAttr($current['filter'])?>">
<div class="facet" data-facet="<?=$this->escapeHtmlAttr($current['filter'])?>">
<a class="checkbox-filter icon-link<?=$isHidden ? ' hidden' : '' ?>" href="<?=$href ?>">
<?php if ($current['selected']): ?>
<span class="sr-only"><?=$this->transEsc('clear_tag_filter') ?></span>
<?php endif; ?>
Expand All @@ -16,15 +16,14 @@
'data-checked' => $current['selected'] ? 'true' : 'false',
]) ?>
<span class="icon-link__label"><?=$this->transEsc($current['desc']) ?></span>

<?php if (!$current['selected']): ?>
<?php
// Note: we need to ensure the element exists (for deferred side facets) but is empty if count is not
// available:
$countEsc = isset($current['count']) ? $this->localizedNumber($current['count']) : '';
?>
<span class="badge avail-count"><?=$countEsc?></span>
<?php endif; ?>
</a>
<?php if (!$current['selected']): ?>
<?php
// Note: we need to ensure the element exists (for deferred side facets) but is empty if count is not
// available:
$countEsc = isset($current['count']) ? $this->localizedNumber($current['count']) : '';
?>
<span class="badge avail-count"><?=$countEsc?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
4 changes: 2 additions & 2 deletions themes/bootstrap5/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ VuFind.register('sideFacets', function SideFacets() {
function activateSingleAjaxFacetContainer() {
var $container = $(this);
var facetList = [];
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkbox-filter[data-facet]');
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkboxFilter [data-facet]');
$facets.each(function addFacet() {
if (!$(this).data('loaded')) {
facetList.push($(this).data('facet'));
Expand Down Expand Up @@ -493,7 +493,7 @@ VuFind.register('sideFacets', function SideFacets() {
.done(function onGetSideFacetsDone(response) {
$.each(response.data.facets, function initFacet(facet, facetData) {
var containerSelector = typeof facetData.checkboxCount !== 'undefined'
? '.checkbox-filter' : ':not(.checkbox-filter)';
? '.checkboxFilter ' : '.facet-group ';
var $facetContainer = $container.find(containerSelector + '[data-facet="' + facet + '"]');
$facetContainer.data('loaded', 'true');
if (typeof facetData.checkboxCount !== 'undefined') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
? $results->getUrlQuery()->removeFilter($current['filter'])
: $results->getUrlQuery()->addFilter($current['filter']);
?>
<div class="facet" >
<a class="checkbox-filter icon-link<?=$isHidden ? ' hidden' : '' ?>" href="<?=$href ?>" data-facet="<?=$this->escapeHtmlAttr($current['filter'])?>">
<div class="facet" data-facet="<?=$this->escapeHtmlAttr($current['filter'])?>">
<a class="checkbox-filter icon-link<?=$isHidden ? ' hidden' : '' ?>" href="<?=$href ?>">
<?php if ($current['selected']): ?>
<span class="sr-only"><?=$this->transEsc('clear_tag_filter') ?></span>
<?php endif; ?>
Expand All @@ -16,15 +16,14 @@
'data-checked' => $current['selected'] ? 'true' : 'false',
]) ?>
<span class="icon-link__label"><?=$this->transEsc($current['desc']) ?></span>

<?php if (!$current['selected']): ?>
<?php
// Note: we need to ensure the element exists (for deferred side facets) but is empty if count is not
// available:
$countEsc = isset($current['count']) ? $this->localizedNumber($current['count']) : '';
?>
<span class="badge avail-count"><?=$countEsc?></span>
<?php endif; ?>
</a>
<?php if (!$current['selected']): ?>
<?php
// Note: we need to ensure the element exists (for deferred side facets) but is empty if count is not
// available:
$countEsc = isset($current['count']) ? $this->localizedNumber($current['count']) : '';
?>
<span class="badge avail-count"><?=$countEsc?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>
2 changes: 1 addition & 1 deletion themes/sandal/css/compiled.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions themes/sandal/less/sandal.less
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ a:hover .login-dropdown-caret {
}
}

.facet .badge {
max-height: 15px;
margin-top: 5px;
}

.more-btn, .less-btn {
border: 0;
border-bottom: 1px solid @list-group-border;
Expand Down
5 changes: 0 additions & 5 deletions themes/sandal/scss/sandal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,6 @@ a:hover .login-dropdown-caret {
}
}

.facet .badge {
max-height: 15px;
margin-top: 5px;
}

.more-btn, .less-btn {
border: 0;
border-bottom: 1px solid $list-group-border;
Expand Down
2 changes: 1 addition & 1 deletion themes/sandal5/css/compiled.css

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions themes/sandal5/scss/sandal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ a:hover .login-dropdown-caret {
}
}

.facet .badge {
max-height: 15px;
margin-top: 5px;
}

.more-btn, .less-btn {
border: 0;
border-bottom: 1px solid $list-group-border;
Expand Down

0 comments on commit ce0a1f6

Please sign in to comment.