Skip to content

Commit

Permalink
Merge branch 'release-10.1' into release-10.1-fix-rating-star-selection
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Dec 3, 2024
2 parents 09995ec + 4c3408e commit 3a4c96f
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 25 deletions.
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ module.exports = function(grunt) {
}
],
options: {
excludes: ['important'],
replacements: [
// Activate SCSS
{
Expand Down
7 changes: 4 additions & 3 deletions module/VuFind/src/VuFind/AjaxHandler/GetSideFacets.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use VuFind\Search\SearchRunner;
use VuFind\Session\Settings as SessionSettings;

use function in_array;
use function is_callable;

/**
Expand Down Expand Up @@ -227,10 +228,10 @@ protected function formatFacets(
) {
$response = [];
$facetSet = $recommend->getFacetSet();
$checkboxFacets = array_column($recommend->getCheckboxFacetSet(), 'filter');
foreach ($facets as $facet) {
if (strpos($facet, ':')) {
$response[$facet]['checkboxCount']
= $this->getCheckboxFacetCount($facet, $results);
if (in_array($facet, $checkboxFacets)) {
$response[$facet]['checkboxCount'] = $this->getCheckboxFacetCount($facet, $results);
} else {
$context['facet'] = $facet;
$context['cluster'] = $facetSet[$facet] ?? [
Expand Down
4 changes: 2 additions & 2 deletions module/VuFind/src/VuFind/ILS/Driver/KohaRest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2104,14 +2104,14 @@ protected function getItemStatusesForBiblio($id, $patron = null, array $options
}
$result = $this->makeRequest($requestParams);
if (404 == $result['code']) {
return [];
return $results;
}
if (200 != $result['code']) {
throw new ILSException('Problem with Koha REST API.');
}

if (empty($result['data']['item_availabilities'])) {
return [];
return $results;
}

// Return total number of results for pagination (with fallback for older
Expand Down
2 changes: 1 addition & 1 deletion themes/bootprint3/css/compiled.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/bootstrap3/css/compiled.css

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions themes/bootstrap3/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,9 @@ VuFind.register('sideFacets', function SideFacets() {
var facetList = [];
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkbox-filters [data-facet]');
$facets.each(function addFacet() {
if (!$(this).data('loaded')) {
if (!$(this).data('initialized')) {
facetList.push($(this).data('facet'));
$(this).data('initialized', 'true');
}
});
if (facetList.length === 0) {
Expand Down Expand Up @@ -485,7 +486,7 @@ VuFind.register('sideFacets', function SideFacets() {
activateFacetBlocking($facetContainer);
}
}
if (isMultiFacetsSelectionEnabled()) {
if (isMultiFacetsSelectionEnabled() && $facetContainer.length > 0) {
VuFind.multiFacetsSelection.initFacetClickHandler($facetContainer.get()[0]);
}
$facetContainer.find('.facet-load-indicator').remove();
Expand All @@ -509,6 +510,13 @@ VuFind.register('sideFacets', function SideFacets() {
$('.side-facets-container-ajax').each(activateSingleAjaxFacetContainer);
}

/**
* Load AJAX side facets with a tiny delay so that all non-collapsed items are available after initialization
*/
function delayLoadAjaxSideFacets() {
setTimeout(loadAjaxSideFacets, 50);
}

function facetSessionStorage(e, data) {
var source = $('#result0 .hiddenSource').val();
var id = e.target.id;
Expand Down Expand Up @@ -551,13 +559,13 @@ VuFind.register('sideFacets', function SideFacets() {
if (VuFind.getBootstrapMajorVersion() === 3) {
$('.side-facets-container-ajax')
.find('div.collapse[data-facet]:not(.in)')
.on('shown.bs.collapse', loadAjaxSideFacets);
.on('shown.bs.collapse', delayLoadAjaxSideFacets);
} else {
document.querySelectorAll('.side-facets-container-ajax div[data-facet]').forEach((collapseEl) => {
collapseEl.addEventListener('shown.bs.collapse', loadAjaxSideFacets);
collapseEl.addEventListener('shown.bs.collapse', delayLoadAjaxSideFacets);
});
}
loadAjaxSideFacets();
delayLoadAjaxSideFacets();

// Keep filter dropdowns on screen
$(".search-filter-dropdown").on("shown.bs.dropdown", function checkFilterDropdownWidth(e) {
Expand Down
10 changes: 10 additions & 0 deletions themes/bootstrap3/less/bootstrap.less
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ footer {
padding: 1rem;
}
@media (min-width: 768px) {
@media (max-width: 991px) {
.container {
max-width: initial;
width: 100%;
}
}
.footer-container {
display: flex;
width: 100%;
Expand All @@ -197,11 +203,15 @@ footer {
.mainbody.left,
.sidebar.left {
float: left;
}
.mainbody.left {
padding-right: 1rem;
}
.mainbody.right,
.sidebar.right {
float: right;
}
.mainbody.right {
padding-left: 1rem;
}
.mainbody.solo {
Expand Down
10 changes: 10 additions & 0 deletions themes/bootstrap3/scss/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ footer {
padding: 1rem;
}
@media (min-width: 768px) {
@media (max-width: 991px) {
.container {
max-width: initial;
width: 100%;
}
}
.footer-container {
display: flex;
width: 100%;
Expand All @@ -197,11 +203,15 @@ footer {
.mainbody.left,
.sidebar.left {
float: left;
}
.mainbody.left {
padding-right: 1rem;
}
.mainbody.right,
.sidebar.right {
float: right;
}
.mainbody.right {
padding-left: 1rem;
}
.mainbody.solo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ $cc-footer-links-gap: 1.3rem !default;
max-width: none!important;
min-width: auto!important;
border-left: none!important;
border-top: 1px solid var(--cc-separator-border-color !important);
border-top: 1px solid var(--cc-separator-border-color)!important;
}

.cm__btn + .cm__btn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,6 @@ $cc-service-toggle-knob-icon-width: 1.7px !default;
}

.show--preferences #cc-main .cc--anim .pm{
transform: translateY(0 !important);
transform: translateY(0)!important;
}
}
2 changes: 1 addition & 1 deletion themes/bootstrap5/css/compiled.css

Large diffs are not rendered by default.

18 changes: 13 additions & 5 deletions themes/bootstrap5/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,9 @@ VuFind.register('sideFacets', function SideFacets() {
var facetList = [];
var $facets = $container.find('div.collapse.in[data-facet], div.collapse.show[data-facet], .checkbox-filters [data-facet]');
$facets.each(function addFacet() {
if (!$(this).data('loaded')) {
if (!$(this).data('initialized')) {
facetList.push($(this).data('facet'));
$(this).data('initialized', 'true');
}
});
if (facetList.length === 0) {
Expand Down Expand Up @@ -485,7 +486,7 @@ VuFind.register('sideFacets', function SideFacets() {
activateFacetBlocking($facetContainer);
}
}
if (isMultiFacetsSelectionEnabled()) {
if (isMultiFacetsSelectionEnabled() && $facetContainer.length > 0) {
VuFind.multiFacetsSelection.initFacetClickHandler($facetContainer.get()[0]);
}
$facetContainer.find('.facet-load-indicator').remove();
Expand All @@ -509,6 +510,13 @@ VuFind.register('sideFacets', function SideFacets() {
$('.side-facets-container-ajax').each(activateSingleAjaxFacetContainer);
}

/**
* Load AJAX side facets with a tiny delay so that all non-collapsed items are available after initialization
*/
function delayLoadAjaxSideFacets() {
setTimeout(loadAjaxSideFacets, 50);
}

function facetSessionStorage(e, data) {
var source = $('#result0 .hiddenSource').val();
var id = e.target.id;
Expand Down Expand Up @@ -551,13 +559,13 @@ VuFind.register('sideFacets', function SideFacets() {
if (VuFind.getBootstrapMajorVersion() === 3) {
$('.side-facets-container-ajax')
.find('div.collapse[data-facet]:not(.in)')
.on('shown.bs.collapse', loadAjaxSideFacets);
.on('shown.bs.collapse', delayLoadAjaxSideFacets);
} else {
document.querySelectorAll('.side-facets-container-ajax div[data-facet]').forEach((collapseEl) => {
collapseEl.addEventListener('shown.bs.collapse', loadAjaxSideFacets);
collapseEl.addEventListener('shown.bs.collapse', delayLoadAjaxSideFacets);
});
}
loadAjaxSideFacets();
delayLoadAjaxSideFacets();

// Keep filter dropdowns on screen
$(".search-filter-dropdown").on("shown.bs.dropdown", function checkFilterDropdownWidth(e) {
Expand Down
10 changes: 10 additions & 0 deletions themes/bootstrap5/scss/bootstrap.scss
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ footer {
padding: 1rem;
}
@media (min-width: 768px) {
@media (max-width: 991px) {
.container {
max-width: initial;
width: 100%;
}
}
.footer-container {
display: flex;
width: 100%;
Expand All @@ -236,11 +242,15 @@ footer {
.mainbody.left,
.sidebar.left {
float: left;
}
.mainbody.left {
padding-right: 1rem;
}
.mainbody.right,
.sidebar.right {
float: right;
}
.mainbody.right {
padding-left: 1rem;
}
.mainbody.solo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ $cc-footer-links-gap: 1.3rem !default;
max-width: none!important;
min-width: auto!important;
border-left: none!important;
border-top: 1px solid var(--cc-separator-border-color !important);
border-top: 1px solid var(--cc-separator-border-color)!important;
}

.cm__btn + .cm__btn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,6 @@ $cc-service-toggle-knob-icon-width: 1.7px !default;
}

.show--preferences #cc-main .cc--anim .pm{
transform: translateY(0 !important);
transform: translateY(0)!important;
}
}
2 changes: 1 addition & 1 deletion themes/local_theme_example/css/compiled.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/sandal/css/compiled.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions themes/sandal/less/sandal.less
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,10 @@ a:hover .login-dropdown-caret {
.exclude { order: 2; }
}
}

@media (max-width: 1399px) {
.sidebar {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
}
7 changes: 7 additions & 0 deletions themes/sandal/scss/sandal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,10 @@ a:hover .login-dropdown-caret {
.exclude { order: 2; }
}
}

@media (max-width: 1399px) {
.sidebar {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
}
2 changes: 1 addition & 1 deletion themes/sandal5/css/compiled.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions themes/sandal5/scss/sandal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,10 @@ a:hover .login-dropdown-caret {
.exclude { order: 2; }
}
}

@media (max-width: 1399px) {
.sidebar {
padding-left: 0.5rem;
padding-right: 0.5rem;
}
}

0 comments on commit 3a4c96f

Please sign in to comment.