Skip to content
Snippets Groups Projects
Commit 34c8a4c1 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #20242 [fid_bbi] add top Recommendation for latest releases

* do not provide link to empty search
* fix permission name

* adds info text
** ... for logged in users without access to licensed material
** fixes English translation

* stay in Releases search, inform user
* fix error concerning homepage search box using stored hidden filters
parent cf836cda
No related merge requests found
...@@ -215,3 +215,12 @@ Infodata = "https://wtiweb.wti-frankfurt.de/fid-bbi" ...@@ -215,3 +215,12 @@ Infodata = "https://wtiweb.wti-frankfurt.de/fid-bbi"
[ExternalDatabases] [ExternalDatabases]
DBIS = true DBIS = true
[SearchTabs]
Solr:main = "All"
Solr:Releases = "Releases"
[SearchTabsFilters]
Solr:Releases[] = 'facet_avail:Local'
Solr:Releases[] = 'publishDateSort:2021'
...@@ -88,3 +88,9 @@ author2_orig = "Alternative Author Name" ...@@ -88,3 +88,9 @@ author2_orig = "Alternative Author Name"
author_corp_ref = "Alternative Corporate Name" author_corp_ref = "Alternative Corporate Name"
author_corporate_orig = "Alternative Corporate Name" author_corporate_orig = "Alternative Corporate Name"
author_corporate2_orig = "Alternative Corporate Name" author_corporate2_orig = "Alternative Corporate Name"
[SideRecommendations]
AllFields[] = SideFacets:Results:CheckboxFacets
[TopRecommendations]
AllFields[] = SwitchTab
...@@ -105,3 +105,13 @@ bbi_twitter_account = "https://twitter.com/FID_BBI" ...@@ -105,3 +105,13 @@ bbi_twitter_account = "https://twitter.com/FID_BBI"
; #20187 genderization ; #20187 genderization
Change Profile Data = "Kontodaten ändern" Change Profile Data = "Kontodaten ändern"
; #20242
Releases = Neuerscheinungen
switchtab_info_releases = Diese Liste enthält nur Neuerscheinungen.
switchtab_with_licenses = Sie können diese Werke kostenlos zur Leihe bestellen. Das Buch wird direkt vom Buchhändler an Sie geschickt. – Die Kosten übernimmt der FID BBI.
switchtab_not_logged_in = Diese Werke können Forschende an deutschen Instituten (Nutzer*innengruppe 1) kostenlos zur Leihe bestellen. <br/>Noch keinen Account? <a href="%%registerUrl%%">Jetzt registrieren</a>.
switchtab_without_licenses = Diese Werke können Forschende an deutschen Instituten (Nutzer*innengruppe 1) kostenlos zur Leihe bestellen.
search_in_tab_releases = In Neuerscheinungen suchen
search_in_tab_all = Im gesamten Katalog nach "%%lookfor%%" suchen
search_everywhere = Neue Recherche im gesamten Katalog
\ No newline at end of file
...@@ -96,3 +96,13 @@ dbis_access_2 = "accessible via a single user license at your home library" ...@@ -96,3 +96,13 @@ dbis_access_2 = "accessible via a single user license at your home library"
bbi_blog_url = "https://www.fid-bbi.de/blog/" bbi_blog_url = "https://www.fid-bbi.de/blog/"
kvk_url = https://kvk.bibliothek.kit.edu/index.html?kataloge=K10PLUS&kataloge=BVB&kataloge=NRW&kataloge=HEBIS&kataloge=KOBV_SOLR&kataloge=DDB&kataloge=STABI_BERLIN&kataloge=TIB&kataloge=VD16&kataloge=VD17&kataloge=VD18&kataloge=BIBOPAC&kataloge=LBOE&kataloge=OENB&kataloge=ABES&kataloge=BASE&kataloge=DART_EUROPE&kataloge=DIGIBIB&kataloge=DFG_EBOOKS&kataloge=DFG_AUFSAETZE&kataloge=DOABOOKS&kataloge=DOAJ&kataloge=EROMM_WEBSEARCH&kataloge=EUROPEANA&kataloge=GOOGLE_BOOKS&kataloge=KUNST_HATHI&kataloge=ARCHIVE_ORG&kataloge=OAPEN&kataloge=ZVDD&kataloge=BHL&lang=en&digitalOnly=1&embedFulltitle=0&newTab=0 kvk_url = https://kvk.bibliothek.kit.edu/index.html?kataloge=K10PLUS&kataloge=BVB&kataloge=NRW&kataloge=HEBIS&kataloge=KOBV_SOLR&kataloge=DDB&kataloge=STABI_BERLIN&kataloge=TIB&kataloge=VD16&kataloge=VD17&kataloge=VD18&kataloge=BIBOPAC&kataloge=LBOE&kataloge=OENB&kataloge=ABES&kataloge=BASE&kataloge=DART_EUROPE&kataloge=DIGIBIB&kataloge=DFG_EBOOKS&kataloge=DFG_AUFSAETZE&kataloge=DOABOOKS&kataloge=DOAJ&kataloge=EROMM_WEBSEARCH&kataloge=EUROPEANA&kataloge=GOOGLE_BOOKS&kataloge=KUNST_HATHI&kataloge=ARCHIVE_ORG&kataloge=OAPEN&kataloge=ZVDD&kataloge=BHL&lang=en&digitalOnly=1&embedFulltitle=0&newTab=0
bbi_twitter_account = "https://twitter.com/FID_BBI" bbi_twitter_account = "https://twitter.com/FID_BBI"
; #20242
Releases = "New Publications"
switchtab_info_releases = This list only contains new publications
switchtab_with_licenses = You can order these new publications for loan free of charge. The book will be sent to you directly from the bookseller. - The costs are covered by the FID BBI.
switchtab_not_logged_in = Researchers at German institutes (user group 1) can order these publications for loan free of charge.<br/>No account yet? <a href="%%registerUrl%%">Register now.</a>
switchtab_without_licenses = Researchers at German institutes (user group 1) can order these publications for loan free of charge.
search_in_tab_releases = Search in new publications
search_in_tab_all = "Search entire catalog for "%%lookfor%%""
search_everywhere = New search in entire catalog
...@@ -156,6 +156,20 @@ ...@@ -156,6 +156,20 @@
} }
} }
.switchtab-links {
li {
margin: g(.25);
&::before {
content: none;
}
}
.icon {
color: currentColor;
}
}
// Only used on default layout // Only used on default layout
.search-menu { .search-menu {
margin: g() 0 0; margin: g() 0 0;
......
<?php
$tabConfig = is_object($this->params)
? $this->searchTabs()->getTabConfigForParams($this->params) : [];
$activeTab = $this->recommend->getActiveTab($tabConfig)["label"] ?? "All";
if (count($tabConfig) > 0 && $activeTab !== "All"): ?>
<!-- fid_bbi: Recommend - SwitchTabs -->
<div class="alert alert-info">
<?php if (count($tabConfig) > 0): ?>
<?=$this->transEsc('switchtab_info_'.strtolower($activeTab))?>
<div class="switchtab-links"><ul>
<li><a class="-icon" href="<?=$this->url('search-home')?>">
<?=$this->icon('arrow-right')?>
<?=$this->translate('search_everywhere')?>
</a></li>
<?php $lookfor = $this->results->getParams()->getQuery()->getString();
if (!empty($lookfor)): ?>
<?php $inactiveTabs = $this->recommend->getInactiveTabs($tabConfig); ?>
<?php foreach ($inactiveTabs as $tab): ?>
<?php if (!$tab['selected']): ?>
<li>
<a class="-icon" href="<?=$this->escapeHtmlAttr($tab['url'])?>">
<?=$this->icon('arrow-right')?>
<?=$this->transEsc(
'search_in_tab_'.strtolower($tab['label']),
[
'%%lookfor%%' => $lookfor,
]
); ?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</ul></div>
<?php endif; ?>
<?php if ($this->permission()->allowDisplay('fid.Acquisitions')):?>
<?=$this->translate('switchtab_with_licenses')?>
<?php elseif ($this->permission()->allowDisplay('fid.LimitedAccess')):?>
<?=$this->translate('switchtab_without_licenses')?>
<?php else: ?>
<?=$this->translate(
'switchtab_not_logged_in',
[
'%%registerUrl%%' =>
$this->url('myresearch-account',[],['query'=>['auth_method'=>'fid']])
]
)?>
<?php endif; ?>
</div>
<!-- fid_bbi: Recommend - SwitchTabs - END -->
<?php endif; ?>
...@@ -59,6 +59,17 @@ ...@@ -59,6 +59,17 @@
<?=$this->translate('Advanced Search')?> <?=$this->translate('Advanced Search')?>
</a> </a>
</li> </li>
<?php $tabConfig = $this->searchTabs()->getTabConfig('Solr', null, null);
foreach ($tabConfig['tabs'] as $tab):
if ($tab['id'] !== 'Solr:main'):
?>
<li>
<a class="-icon" href="<?=$tab['url']?>">
<?=$this->icon('arrow-right')?>
<?=$this->translate($tab['label'])?>
</a>
</li>
<?php endif; endforeach;?>
</ul> </ul>
</div> </div>
<?php else: ?> <?php else: ?>
......
...@@ -4,18 +4,14 @@ ...@@ -4,18 +4,14 @@
<!-- fid_bbi: layout - layout --> <!-- fid_bbi: layout - layout -->
<?php $isHome = $this->templateDir === 'search' && $this->templateName === 'home'; ?> <?php $isHome = $this->templateDir === 'search' && $this->templateName === 'home'; ?>
<body class="layout <?=$isHome ? '-home' : '-default'?>"> <body class="layout <?=$isHome ? '-home' : '-default'?>">
<?php // Set up the search box -- there are three possible cases: <?php
// 1. No search box was set; we should default to the normal box
// 2. It was set to false; we should display nothing
// 3. It is set to a custom string; we should display the provided version
// Set up default search box if no data was provided from the template;
// this covers case 1. Cases 2 and 3 are then covered by logic below.
if ( if (
$this->templateName === 'advanced' $this->templateName === 'advanced'
|| $this->templateDir === 'records' || $this->templateDir === 'records'
|| !isset($this->layout()->searchbox) || !isset($this->layout()->searchbox)
) { ) {
$this->layout()->searchbox = $this->render('search/searchbox.phtml'); // reset searchbox in case we did leave the results page
$this->layout()->searchbox = $this->render('search/searchbox.phtml', ['ignoreHiddenFilterMemory' => true]);
} }
?> ?>
<?php // Add landmark role to avoid 'all content must be inside landmarks error', CK ?> <?php // Add landmark role to avoid 'all content must be inside landmarks error', CK ?>
......
...@@ -77,6 +77,10 @@ $this->headScript()->appendFile("check_save_statuses.js"); ...@@ -77,6 +77,10 @@ $this->headScript()->appendFile("check_save_statuses.js");
<?=$this->flashmessages()?> <?=$this->flashmessages()?>
<?php foreach ($top = $this->results->getRecommendations('top') as $index => $current): ?>
<?=$this->recommend($current, 'top', $index)?>
<?php endforeach; ?>
<div class="results-header"> <div class="results-header">
<?php if ($this->params->getSearchType() === 'advanced'):?> <?php if ($this->params->getSearchType() === 'advanced'):?>
<?=$this->render('search/advanced-search-info.phtml');?> <?=$this->render('search/advanced-search-info.phtml');?>
...@@ -102,10 +106,6 @@ $this->headScript()->appendFile("check_save_statuses.js"); ...@@ -102,10 +106,6 @@ $this->headScript()->appendFile("check_save_statuses.js");
<p class="alert alert-danger"><?=$this->transEsc('nohit_parse_error')?></p> <p class="alert alert-danger"><?=$this->transEsc('nohit_parse_error')?></p>
<?php endif; ?> <?php endif; ?>
<?php foreach (($top = $this->results->getRecommendations('top')) as $index => $current): ?>
<?=$this->recommend($current, 'top', $index)?>
<?php endforeach; ?>
<?php foreach ($this->results->getRecommendations('noresults') as $index => $current): ?> <?php foreach ($this->results->getRecommendations('noresults') as $index => $current): ?>
<?php if (!in_array($current, $top)): ?> <?php if (!in_array($current, $top)): ?>
<?=$this->recommend($current, 'noresults', $index)?> <?=$this->recommend($current, 'noresults', $index)?>
...@@ -208,10 +208,6 @@ $this->headScript()->appendFile("check_save_statuses.js"); ...@@ -208,10 +208,6 @@ $this->headScript()->appendFile("check_save_statuses.js");
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<?php foreach ($this->results->getRecommendations('top') as $index => $current): ?>
<?=$this->recommend($current, 'top', $index)?>
<?php endforeach; ?>
<?php endif; ?> <?php endif; ?>
<?php foreach ($this->results->getRecommendations('side') as $index => $current): ?> <?php foreach ($this->results->getRecommendations('side') as $index => $current): ?>
......
...@@ -51,8 +51,6 @@ $tabConfig = $this->searchTabs()->getTabConfig( ...@@ -51,8 +51,6 @@ $tabConfig = $this->searchTabs()->getTabConfig(
); );
?> ?>
<?php // TODO: Use longer placeholder on large screen, like in the mockup? ?>
<?php $placeholder = $this->translate('search_terms'); ?>
<form <form
action="<?=$this->url($basicSearch)?>" action="<?=$this->url($basicSearch)?>"
autocomplete="off" autocomplete="off"
...@@ -66,8 +64,12 @@ $tabConfig = $this->searchTabs()->getTabConfig( ...@@ -66,8 +64,12 @@ $tabConfig = $this->searchTabs()->getTabConfig(
isset($this->filterList) && is_array($this->filterList) ? $this->filterList : [], isset($this->filterList) && is_array($this->filterList) ? $this->filterList : [],
isset($this->checkboxFilters) && is_array($this->checkboxFilters) ? $this->checkboxFilters : [] isset($this->checkboxFilters) && is_array($this->checkboxFilters) ? $this->checkboxFilters : []
); );
$filterActive = !empty($filterDetails) $filterActive = !empty($filterDetails);
|| (($tabConfig['tabs'][0]['label'] ?? '') !== ($tabConfig['selected']['label'] ?? '')); $searchTab = $tabConfig['selected']['label'] ?? '';
$searchTabsActive = $searchTab !== ($tabConfig['tabs'][0]['label'] ?? '');
$placeholder = $searchTabsActive
? $this->translate('search_in_tab_'.strtolower($searchTab))
: $this->translate('search_terms');
?> ?>
<input <input
...@@ -132,6 +134,12 @@ $tabConfig = $this->searchTabs()->getTabConfig( ...@@ -132,6 +134,12 @@ $tabConfig = $this->searchTabs()->getTabConfig(
</div> </div>
<?php endif; ?> <?php endif; ?>
<?php foreach ($hiddenFilters as $key => $filter): ?>
<?php foreach ($filter as $value): ?>
<input type="hidden" name="hiddenFilters[]" value="<?=$this->escapeHtmlAttr($key) . ':' . $this->escapeHtmlAttr($value)?>" />
<?php endforeach; ?>
<?php endforeach; ?>
<button class="search-submit" type="submit"> <button class="search-submit" type="submit">
<?=$this->icon('magnifier')?> <?=$this->icon('magnifier')?>
<?=$this->transEsc('Find')?> <?=$this->transEsc('Find')?>
......
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