diff --git a/local/languages/de.ini b/local/languages/de.ini index 2e03d31e37b6459de5cac36cb96d56d07aaf1908..0fd0654be21865e07f6d9d2a81d1fc2750c87863 100644 --- a/local/languages/de.ini +++ b/local/languages/de.ini @@ -717,6 +717,7 @@ errorcode_password_validation_error = "Das übergebene Password ist nicht korrek errorcode_old_password_validation_error = "Die Kombination aus Benutzernummer und Kennwort ist nicht gültig. Bitte überprüfen Sie Ihre Eingabe." errorcode_empty_req_param_error = "Um das Formular erfolgreich zu senden, müssen alle erforderlichen Felder ausgefüllt sein" exclude_newspapers = "Ohne Zeitungsartikel" +exclude_filter = "Filter "%%filter_name%%" ausschließen" export_download = "Datei herunterladen" export_exporting = "Exportdatei erstellen" export_fail = "Ihre Datensätze wurden nicht exportiert" @@ -876,6 +877,9 @@ on_reserve = "Vorgemerkt - Fragen Sie an der Ausleihe nach" online_resources = "Sonstige" or = "oder" create a new list = "erstellen Sie eine neue Liste" +page_reload_hint = "Seite wird neu geladen" +page_reload_on_select_hint = "Seite wird bei Auswahl des Filters "%%filter_name%%" neu geladen" +page_reload_on_deselect_hint = "Seite wird neu geladen, wenn der Filter "%%filter_name%%" abgewählt wird" password_too_short = "Zu kurz" password_very_weak = "Sehr schwach" password_weak = "Schwach" @@ -1984,6 +1988,8 @@ Modal_description = "Sie befinden sich in einem Dialogfenster, das über dem Hau Skip_navigation_links = "Sprunglinks zum Inhalt" Skip to search = "Zum Suchbereich" Skip to content = "Zum Inhalt" +Skip to facet = "Zu ihrem ausgewählten Suchfilter "%%filter_name%%" springen" +skip-to = "Zu" ; Overwrite, only in de.ini necessary: Search type = "Suchtyp" diff --git a/local/languages/en.ini b/local/languages/en.ini index 8c62e01e09fdeb500a39b5ec1c296eabb6fbcb88..277299f8cd95148fdc5548d2842e67a33a4bed33 100644 --- a/local/languages/en.ini +++ b/local/languages/en.ini @@ -702,6 +702,7 @@ errorcode_empty_password = "Some data was missing. No password was submitted" errorcode_member_not_found = "The member number does not exist" errorcode_password_validation_error = "Your passed password is not correct" errorcode_empty_req_param_error = "All required fields have to be filled to submit successfully the form" +exclude_filter = "Exclude filter "%%filter_name%%"" exclude_newspapers = "Exclude Newspaper Articles" export_download = "Download File" export_exporting = "Creating Export File" @@ -839,6 +840,9 @@ of = of on_reserve = "Reserves - Please contact staff" online_resources = "Online Resources" create a new list = "Create a New List" +page_reload_hint = "Page will refresh immediately" +page_reload_on_select_hint = "Page will refresh when filter "%%filter_name%%" is selected" +page_reload_on_deselect_hint = "Page will refresh when filter "%%filter_name%%" is deselected" password_too_short = "Too short" password_very_weak = "Very weak" password_weak = "Weak" @@ -2083,8 +2087,8 @@ ReliefPrint = "Printmaking" Modal_description = "This is a dialog window which overlays the main content of the page. Pressing the Escape key or the Close Dialog Window button will close the modal and bring you back to where you were on the page." Skip_navigation_links = "Skip navigation links" Skip to search = "Skip to search" -; only necessary in en.ini skip-to = "Skip to " +Skip to facet = "Skip to your selected search filter "%%filter_name%%"" License = "License" diff --git a/module/fid/src/Service/DataTransferObject/User.php b/module/fid/src/Service/DataTransferObject/User.php index c36b760197444ccb9f4d6d8a6342726357b6c148..b2704cf9b31db72768096ea79f52f68098fee08d 100644 --- a/module/fid/src/Service/DataTransferObject/User.php +++ b/module/fid/src/Service/DataTransferObject/User.php @@ -409,6 +409,14 @@ class User } } + /** + * @return boolean + */ + public function isNewsletter(): bool + { + return !empty($this->getData()["newsletter"]) ? $this->getData()["newsletter"] : 0; + } + /** * @param Address[] $addresses */ diff --git a/module/finc/src/finc/View/Helper/Root/SideFacet.php b/module/finc/src/finc/View/Helper/Root/SideFacet.php index fefb2febee6eec8cb6e087a493bd12edd40a63e2..6bcabed6194318a930e57822cd303ae2ce4e70ea 100644 --- a/module/finc/src/finc/View/Helper/Root/SideFacet.php +++ b/module/finc/src/finc/View/Helper/Root/SideFacet.php @@ -71,6 +71,13 @@ class SideFacet extends AbstractHelper } } + /** + * Applied facets + * + * @var array + */ + protected $appliedFacets; + /** * Checks whether the user is logged in. * @@ -135,4 +142,29 @@ class SideFacet extends AbstractHelper return "<$element $attributesString>$term</$element>"; } } + + /** + * @param string $displayText + * @param string $id + * + * @return string $id + */ + public function setAppliedFacet($displayText, $id = null): string + { + $id = $id ?? crc32($displayText); + $tuple = [$id => $displayText]; + empty($this->appliedFacets) ? $this->appliedFacets = $tuple : $this->appliedFacets += $tuple; + + return $id; + } + + /** + * Returns an associative array of html id => facet display title + * + * @return array|null + */ + public function getAppliedFacets(): ?array + { + return $this->appliedFacets; + } } diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml new file mode 100644 index 0000000000000000000000000000000000000000..aa6790b82c6929dfadb2a86c7e25cedfb00e29e7 --- /dev/null +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/facet.phtml @@ -0,0 +1,68 @@ +<!-- finc-accessibility - Recommend - SideFacets - facet.phtml --> +<?php /* #18993 copied from bootstrap to show all applied facets */ ?> +<?php + $this->results = $results = $this->recommend->getResults(); + $this->options = $options = $results->getOptions(); + $hierarchicalFacetSortOptions = $this->recommend->getHierarchicalFacetSortOptions(); + $hierarchicalFacets = $this->recommend->getHierarchicalFacets(); + $collapsedFacets = $this->recommend->getCollapsedFacets(); + $rangeFacets = $this->recommend->getAllRangeFacets(); + $facet = $this->facet; +?> +<?php if (isset($rangeFacets[$facet])): // special display for ranges ?> + <?=$this->context($this)->renderInContext( + 'Recommend/SideFacets/range-slider.phtml', + ['title' => $facet, 'facet' => $rangeFacets[$facet]] + ); ?> +<?php else: ?> + <?php + // Set some variables so we can figure out which sub-template(s) to + // render. If we have a hierarchical facet, we will need to render a + // jsTree Javascript-based template. If we also support non-JS browsers, + // we will also need to render the basic default template. If we + // do NOT support non-JS browsers, we should instead display an error + // message. + $isHierarchical = in_array($facet, $hierarchicalFacets); + $noJsSupport = $this->config()->nonJavascriptSupportEnabled(); + ?> + <?php if ($isHierarchical): // do we need hierarchical JS display? ?> + <?=$this->context($this)->renderInContext( + 'Recommend/SideFacets/hierarchical-facet.phtml', + [ + 'allowExclude' => $this->recommend->excludeAllowed($facet), + 'title' => $facet, + 'sortOptions' => $hierarchicalFacetSortOptions[$facet] ?? '', + 'collapsedFacets' => $collapsedFacets + ] + ); ?> + <noscript> + <?php if (!$noJsSupport): ?> + <span class="facet"><?=$this->transEsc('Please enable JavaScript.')?></span> + <?php endif; ?> + <?php endif; ?> + <?php if (!$isHierarchical || $noJsSupport): // do we need regular display? ?> + <?php + /* finc specific: do not hide selected facet within more-cluster */ + $facetsBeforeMore = $this->recommend->getShowMoreSetting($facet); + foreach ($cluster['list'] as $i => $clusterFacet) { + if ($clusterFacet['isApplied'] && $i + 1 > $facetsBeforeMore) { + $facetsBeforeMore = $i + 1; + } + } + /* finc specific - END */ + ?> + <?=$this->context($this)->renderInContext( + 'Recommend/SideFacets/cluster-list.phtml', + [ + 'options' => $options, 'title' => $facet, 'cluster' => $cluster, + 'allowExclude' => $this->recommend->excludeAllowed($facet), + 'facets_before_more' => $facetsBeforeMore, + 'showMoreInLightbox' => $this->recommend->getShowInLightboxSetting($facet) + ] + ); ?> + <?php endif; ?> + <?php if ($isHierarchical): // close tag opened in matching if above ?> + </noscript> + <?php endif; ?> +<?php endif; ?> +<!-- finc-accessibility - Recommend - SideFacets - facet.phtml - END --> diff --git a/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml b/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml index d7e75e1a60ccff2ce9e4bf5a8cdb58d4fe7bdc24..e2bcbb9c9e466615696ac66aaa5165e1a143d182 100644 --- a/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml +++ b/themes/finc-accessibility/templates/Recommend/SideFacets/filter-list.phtml @@ -18,7 +18,7 @@ $filter['displayText'] = $this->translate('filter_wildcard'); } ?> - <a class="facet" href="<?=$removeLink ?>" title="<?=$this->transEsc('clear_tag_filter') ?>"> + <a class="facet" href="<?=$removeLink ?>" title="<?=$this->transEsc('clear_tag_filter') ?> - <?=$this->transEsc('page_reload_on_deselect_hint', ['%%filter_name%%' => $filter['displayText']])?>"> <span class="sr-only"><?=$this->transEsc('clear_tag_filter') ?></span> <span class="text"> <?php if ($filter['operator'] == 'NOT'): ?><?=$this->transEsc('NOT') ?><?php endif; ?> @@ -30,4 +30,4 @@ <?php endforeach; ?> <?php endforeach; ?> </div> -<!-- finc-accessibility - Recommend - SideFacets - filter-list.phtml - END --> +<!-- finc-accessibility - Recommend - SideFacets - filter-list.phtml - END --> diff --git a/themes/finc/js/common-finc.js b/themes/finc/js/common-finc.js index 06e842b6b637e2da0e189de402954561295f1408..3b80a9ac86ae05382047455ec593beb1df9b27ad 100644 --- a/themes/finc/js/common-finc.js +++ b/themes/finc/js/common-finc.js @@ -24,3 +24,25 @@ function setupOffcanvas() { }); } } + +/* use css class 'skip-to' to jump to landmark - RL */ +$(document).ready(function () { + $(document).on('click enter',".skip-to", function (e) { + if (e.type === 'enter' && e.keyCode !== 13) { + return; + } + + if (this.hash) { + e.stopPropagation(); + e.preventDefault(); + let offset = $(this.hash).offset().top; + let banner = $('.banner .container'); + if (banner !== undefined) { + offset -= banner.height() + 10; + } + $('html, body').animate( + {scrollTop: offset}, 500, 'swing', $(this.hash).focus() + ); + } + }); +}); \ No newline at end of file diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 79421497168e1b1eaf06068475fd9e8e037d41fd..8a5183ea841f34b9e2d1c901662c38a50dd5ad62 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -1866,6 +1866,12 @@ footer { } } +.mainbody { + @media screen and (max-width: $screen-xs-max) { + width: 100%; + } +} + footer { border-top: 0; padding-top: ($grid-gutter-width / 1.5); diff --git a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml index 8dc4975ac49b1517a6df1e19420c422314e385f9..430be23580f50ce2ba0fccf96c7bb22bdf494db6 100644 --- a/themes/finc/templates/Recommend/SideFacets/range-slider.phtml +++ b/themes/finc/templates/Recommend/SideFacets/range-slider.phtml @@ -5,6 +5,11 @@ */ ?> <div class="facet"> + <?php if (!empty($this->facet['values'][0])): ?> + <?php $this->sideFacet()->setAppliedFacet($this->transEsc('Skip to facet', ['%%filter_name%%' => $this->transEsc('Year of Publication')]), $this->escapeHtmlAttr($this->title) . 'from')?> + <?php elseif (!empty($this->facet['values'][1])): ?> + <?php $this->sideFacet()->setAppliedFacet($this->transEsc('Skip to facet', ['%%filter_name%%' => $this->transEsc('Year of Publication')]), $this->escapeHtmlAttr($this->title) . 'to')?> + <?php endif; ?> <form name="<?=$this->escapeHtmlAttr($this->title)?>Filter" id="<?=$this->escapeHtmlAttr($this->title)?>Filter"> <?=$results->getUrlQuery()->asHiddenFields(['page' => "/./", 'filter' => "/^{$this->title}:.*/"])?> <input type="hidden" name="<?=$this->escapeHtmlAttr($this->facet['type'])?>range[]" value="<?=$this->escapeHtmlAttr($this->title)?>"/> diff --git a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml index bedb8055591bb54649d1295fab44e0d0510c0d48..054dcc31a94decb722a11827fea8b9afff4a6e0d 100644 --- a/themes/finc/templates/Recommend/SideFacets/single-facet.phtml +++ b/themes/finc/templates/Recommend/SideFacets/single-facet.phtml @@ -33,11 +33,23 @@ <?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> + <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: ?> @@ -48,13 +60,15 @@ <?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 $excludeURL = $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], 'NOT'); ?> - <a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude"><i class="fa fa-times" aria-hidden="true"></i><span class="sr-only"><?=$this->transEsc('exclude_facet') ?></span> </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 ? '</div>' : '</a>'; ?> diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml index 0ec319d7ed627ac142d57492d419004954a8393c..c2b6a370feb8ac53c20deecea4b26f0bd41c64b7 100644 --- a/themes/finc/templates/layout/layout.phtml +++ b/themes/finc/templates/layout/layout.phtml @@ -181,10 +181,18 @@ if (!isset($this->layout()->searchbox)) { <?php endif; ?> <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a> <?php if (substr_count(strtolower($this->layout()->templateName), 'results') > 0): ?> - <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?> - <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a> + <?php $applied = $this->sideFacet()->getAppliedFacets(); ?> + <?php if (!empty($applied)): ?> + <?php foreach ($applied as $appliedId => $appliedText): ?> + <?php if ($appliedId && $appliedText): ?> + <?php /* use css class 'skip-to' to jump to landmark - RL */?> + <a class="sr-only hidden-xs skip-to" href="#<?=$appliedId?>"><?=$appliedText?></a> + <?php endif; ?> + <?php endforeach; ?> + <?php elseif (strcmp($this->layout()->userLang, 'de') == 0): ?> + <a class="sr-only hidden-xs skip-to" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a> <?php else: ?> - <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a> + <a class="sr-only hidden-xs skip-to" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a> <?php endif; ?> <?php endif; ?> </div>