diff --git a/themes/fid_bbi/icons/small/pen.svg b/themes/fid_bbi/icons/small/pen.svg new file mode 100644 index 0000000000000000000000000000000000000000..55d0b8f911e7e24bf1254132b40e801d305b9f1e --- /dev/null +++ b/themes/fid_bbi/icons/small/pen.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" height="28" width="28"><path d="M22 2l4 4L8 24H4v-4zm-3 3l4 4" fill="none"/></svg> diff --git a/themes/fid_bbi/icons/small/trash.svg b/themes/fid_bbi/icons/small/trash.svg new file mode 100644 index 0000000000000000000000000000000000000000..c95f961fc7a1542296be7103cf75340c8415c808 --- /dev/null +++ b/themes/fid_bbi/icons/small/trash.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" height="28" width="28"><path d="M3 5h22M11 5V1h6v4M6 5v19h16V5M10 8v13m8-13v13M14 8v13" fill="none"/></svg> diff --git a/themes/fid_bbi/js/theme.js b/themes/fid_bbi/js/theme.js index 3f131cbf59ab1a206a53cd55fd27d574bab73f72..dffaee2089c897b61ea91f316c65d6ed9890248c 100644 --- a/themes/fid_bbi/js/theme.js +++ b/themes/fid_bbi/js/theme.js @@ -8,6 +8,7 @@ const theme = { rowTemplate: null, scrollPos: 0, + sidebar: null, init() { theme.initSelects() @@ -28,6 +29,13 @@ const theme = { theme.updateScrolled() window.addEventListener('scroll', theme.updateScrolled) + // Close open sidebar when viewport size changes + window.addEventListener('resize', () => { + if (theme.sidebar && theme.sidebar.classList.contains('-open')) { + theme.toggleSidebar() + } + }) + // Handle aria-based toggles window.addEventListener('click', (event) => { const button = event.target.closest('a, button') @@ -150,10 +158,17 @@ const theme = { event.target.parentElement.classList.toggle('-collapsed') }, toggleSidebar(id) { - const sidebar = document.getElementById(id) - if (!sidebar.classList.contains('-open')) { + if (id) { + theme.sidebar = document.getElementById(id) + } + + if (!theme.sidebar) { + return + } + + if (!theme.sidebar.classList.contains('-open')) { // Focus input when sidebar is halfway visible - const input = sidebar.querySelector('[data-focus-off-canvas]') + const input = theme.sidebar.querySelector('[data-focus-off-canvas]') if (input) { setTimeout(() => { input.select() }, 125) } @@ -163,7 +178,7 @@ const theme = { theme.scroll.unlock() } - sidebar.classList.toggle('-open') + theme.sidebar.classList.toggle('-open') // TODO: aria-expanded should be set, but multiple buttons may be affected }, diff --git a/themes/fid_bbi/languages/de.ini b/themes/fid_bbi/languages/de.ini index 5ad29ff59a3c50b9039182f1727904cca81d6995..49f76ab5ffc34fb45cbb9352404f3df2d8b64152 100644 --- a/themes/fid_bbi/languages/de.ini +++ b/themes/fid_bbi/languages/de.ini @@ -19,6 +19,7 @@ New Publications = Neuerscheinungen Open navigation = Navigation öffnen Open search = Suche öffnen Page %%current%% of %%total%% = Seite %%current%% von %%total%% +Personal Data = Persönliche Daten Recent Blog Posts = Neueste Blog-Einträge Remove all filters = Alle Filter entfernen Scroll to top = Nach oben scrollen @@ -32,6 +33,9 @@ the year = zum Jahr This field is required = Pflichtfeld to = bis +history_purge = Nicht gespeicherte Suchanfragen entfernen +history_recent_searches = Ihre aktuellen Suchanfragen + home_about_1 = <p class="-columns">Der Fachinformationsdienst Buch-, Bibliotheks- und InformationsÂwissenÂschaft (FID BBI) stellt SpezialÂliteratur und forschungsÂrelevante InformaÂtionen für Forschende der drei DisziÂplinen zur Verfügung. Das HerzÂstück bildet das umfangreiche RechercheÂwerkzeug in dem Forschende, Lehrende und StudieÂrende in über 3 Millionen DatenÂsätzen gezielt recherÂchieren können. Der DatenÂpool speist sich aus über 30 DatenÂquellen, die regelÂmäßig aktualiÂsiert und ergänzt werden.</p> home_about_2 = <h2>Anregungen und Feedback</h2><p>Der FID BBI richtet sich an den Bedarfen der Forschenden aus. Vermissen Sie eine Datenquelle, können Sie einen bestimmten Titel nicht finden oder suchen Sie ausführlichere Informationen zum FID BBI, <a href="%%feedback_url%%">kontaktieren Sie uns</a> oder <a href="%%blog_url%%">besuchen Sie unser Blog</a>.</p> home_about_3 = <h2>Bereitstellung von Spezialliteratur</h2><p>Für Forschende der Fächer Buch-, Bibliotheks- und Informationswissenschaft lizenziert der FID BBI fachspezifische Datenbanken, auf die über das Nachweisportal zugegriffen werden kann. Außerdem können Forschende Spezialliteratur direkt über den FID BBI beziehen.</p><p>Haben Sie die von Ihnen gesuchte Publikation nicht gefunden, <a href="%%feedback_url%%">kontaktieren Sie uns</a>. Wir kümmern uns darum.</p> diff --git a/themes/fid_bbi/languages/en.ini b/themes/fid_bbi/languages/en.ini index c502ff71856c74fe139842b44e52d817ffdb82c6..c70c1400e369ca14fc17e306d0b4107d1d5f538b 100644 --- a/themes/fid_bbi/languages/en.ini +++ b/themes/fid_bbi/languages/en.ini @@ -6,11 +6,15 @@ For Subject Specialists = For Subject Specialists New Publications = New Publications Open navigation = Open navigation Open search = Open search +Profile Menu = Profilmenü Recent Blog Posts = Recent Blog Posts Scroll to top = Scroll to top Team = Team This field is required = This field is required +history_purge = Discard unsaved searches +history_recent_searches = Your Recent Searches + home_about_1 = <p class="-columns">TODO: Translate. Der Fachinformationsdienst Buch-, Bibliotheks- und InformationsÂwissenÂschaft (FID BBI) stellt SpezialÂliteratur und forschungsÂrelevante InformaÂtionen für Forschende der drei DisziÂplinen zur Verfügung. Das HerzÂstück bildet das umfangreiche RechercheÂwerkzeug in dem Forschende, Lehrende und StudieÂrende in über 3 Millionen DatenÂsätzen gezielt recherÂchieren können. Der DatenÂpool speist sich aus über 30 DatenÂquellen, die regelÂmäßig aktualiÂsiert und ergänzt werden.</p> home_about_2 = <h2>TODO: Translate. Anregungen und Feedback</h2><p>Der FID BBI richtet sich an den Bedarfen der Forschenden aus. Vermissen Sie eine Datenquelle, können Sie einen bestimmten Titel nicht finden oder suchen Sie ausführlichere Informationen zum FID BBI, <a href="%%feedback_url%%">kontaktieren Sie uns</a> oder <a href="%%blog_url%%">besuchen Sie unser Blog</a>.</p> home_about_3 = <h2>TODO: Translate. Bereitstellung von Spezialliteratur</h2><p>Für Forschende der Fächer Buch-, Bibliotheks- und Informationswissenschaft lizenziert der FID BBI fachspezifische Datenbanken, auf die über das Nachweisportal zugegriffen werden kann. Außerdem können Forschende Spezialliteratur direkt über den FID BBI beziehen.</p><p>Haben Sie die von Ihnen gesuchte Publikation nicht gefunden, <a href="%%feedback_url%%">kontaktieren Sie uns</a>. Wir kümmern uns darum.</p> diff --git a/themes/fid_bbi/scss/base/common.scss b/themes/fid_bbi/scss/base/common.scss index 69476ececf7240a275cb82b21979a6642b65ab2a..a3cc946464c5c78091dea1f6bfe792d935a419f6 100644 --- a/themes/fid_bbi/scss/base/common.scss +++ b/themes/fid_bbi/scss/base/common.scss @@ -27,6 +27,17 @@ a { box-shadow: 0 2px; text-decoration: none; } + + // Override Bootstrap reboot - some <a> only have an onclick attribute, + // others don't have any attributes, but are still used to close dropdowns + &:not([href]):not([class]) { + color: $link-color; + cursor: pointer; + + @include hover() { + color: $link-hover-color; + } + } } address { @@ -243,16 +254,18 @@ pre { table { @include paragraph; width: 100%; -} - -td { - padding: g(.25) 0; - + td { - padding-left: g(.5); + &.-wide { + max-width: none; } } +th { + color: $text-muted-color; + font-weight: bold; +} + +td, th { padding: g(.25) 0; @@ -263,7 +276,7 @@ th { } tr { - box-shadow: 0 -2px $text-muted-color inset; + box-shadow: 0 -2px #000 inset; } ul { diff --git a/themes/fid_bbi/scss/base/form.scss b/themes/fid_bbi/scss/base/form.scss index 0c45066260f1f3b94f3647b88facd4aee742b00f..d51fcb622d09ba5de8758d39a818cdb649c05a5e 100644 --- a/themes/fid_bbi/scss/base/form.scss +++ b/themes/fid_bbi/scss/base/form.scss @@ -5,6 +5,7 @@ } button, +[type=button], [type=submit] { @include button; @@ -33,6 +34,12 @@ fieldset { border: 2px solid; margin-bottom: g(); padding: g() - 2px; + + &.-limit-width { + margin-left: auto; + margin-right: auto; + max-width: $line-width; + } } form { @@ -50,9 +57,9 @@ label { margin: 0; user-select: none; - &[data-required] { + &[data-required=true] { &::after { - color: $color-b; + color: $color-a; content: '*'; margin-left: .2em; } diff --git a/themes/fid_bbi/scss/blocks/alert.scss b/themes/fid_bbi/scss/blocks/alert.scss index 7a7720453dae2683e1f33701caac200c75069834..a83de1080c1bf884e9cc0329f70b276d4fbe6313 100644 --- a/themes/fid_bbi/scss/blocks/alert.scss +++ b/themes/fid_bbi/scss/blocks/alert.scss @@ -43,4 +43,10 @@ .main_wrap > &:first-child { margin-top: g(); } + + // If the alert is the first child of a modal without a heading, prevent the + // alert from overlapping with the close button + .modal &:first-child { + margin-right: g(2.5); + } } diff --git a/themes/fid_bbi/scss/blocks/browse.scss b/themes/fid_bbi/scss/blocks/browse.scss new file mode 100644 index 0000000000000000000000000000000000000000..b0f5f1253338428ea0c1a1b70c09c2a54bdb1e25 --- /dev/null +++ b/themes/fid_bbi/scss/blocks/browse.scss @@ -0,0 +1,12 @@ +.browse { + @media #{$bp4} { + display: flex; + } + + > ul { + margin: 0 0 g(); + border-left: 2px solid; + padding-left: g() - 2px; + width: 25%; + } +} diff --git a/themes/fid_bbi/scss/blocks/required.scss b/themes/fid_bbi/scss/blocks/required.scss deleted file mode 100644 index d9ffa1312a82c194918d99238844c6f0857186cb..0000000000000000000000000000000000000000 --- a/themes/fid_bbi/scss/blocks/required.scss +++ /dev/null @@ -1,7 +0,0 @@ -.required { - &::after { - color: $color-b; - content: '*'; - font-weight: 500; - } -} diff --git a/themes/fid_bbi/scss/blocks/result.scss b/themes/fid_bbi/scss/blocks/result.scss index 85eb8d804d4f8bab04728344695d09c62e66f881..b2116375f50c5dfd49d37409480a17dc4e05003e 100644 --- a/themes/fid_bbi/scss/blocks/result.scss +++ b/themes/fid_bbi/scss/blocks/result.scss @@ -11,7 +11,8 @@ .result_actions { margin: g(-.25) g(.25) g(-.25) g(.25 + 1); - a { + > a, + > .dropdown > a { display: block; margin: g(.25) g(-.25) g(-.25); padding: g(.25); @@ -60,10 +61,6 @@ padding-left: g() - 2px; } -.result_title { - margin: 0 0 g(.5); -} - .result_link { @include extend-clickable-area; display: block; @@ -91,6 +88,14 @@ // } +.result_title { + margin-bottom: g(.5); + + a { + color: inherit; + } +} + .result_type { display: none; flex: 0 0 g(3); diff --git a/themes/fid_bbi/scss/blocks/results.scss b/themes/fid_bbi/scss/blocks/results.scss index ed3d2197be4dc2060747ccef19d0e05f5253fba7..98ac8a76182c2b30fb240a266e346d56a9cb0023 100644 --- a/themes/fid_bbi/scss/blocks/results.scss +++ b/themes/fid_bbi/scss/blocks/results.scss @@ -9,9 +9,10 @@ margin: g(-.25); margin-bottom: g(-.25 + 1); - a { - @include button-icon-bg(small); + a, + button { @include button-small; + @include button-icon-bg(small); display: flex; margin: g(.25); white-space: nowrap; @@ -39,6 +40,29 @@ } } +.results_bulk-actions { + margin: 0 0 g(); +} + +.results_bulk-buttons { + display: flex; + margin: g(-.25); + flex-wrap: wrap; + + > button { + margin: g(.25); + width: 100%; + + @media #{$bp1} { + width: auto; + } + } +} + +.results_bulk-selection { + margin: 0 0 g(.5); +} + .results_count { margin: g(.25); } @@ -84,6 +108,17 @@ @media #{$bp5} { margin-left: g(-.25 + 4); } + + &.-wide { + @media #{$bp5} { + margin-left: g(-.25); + } + + // When there is an alert directly after the header, the header is empty + + .alert { + margin-top: g(-.5); + } + } } .results_list { @@ -93,6 +128,33 @@ @media #{$bp5} { margin-left: g(6); } + + &.-wide { + @media #{$bp5} { + margin-left: g(); + } + } + + h2, + h3, + p, + table { + max-width: none; + } +} + +.results_list-actions { + display: flex; + margin: g(-.25); + flex-wrap: wrap; + + > * { + margin: g(.25) g(.5); + } +} + +.results_list-description { + max-width: none; } .results_pagination { diff --git a/themes/fid_bbi/scss/blocks/sidebar.scss b/themes/fid_bbi/scss/blocks/sidebar.scss index ad50231904da1785b56c3dd0770dd4f1f4b9736a..0433a1e6109acb97be32e76949d4674a15af05c0 100644 --- a/themes/fid_bbi/scss/blocks/sidebar.scss +++ b/themes/fid_bbi/scss/blocks/sidebar.scss @@ -12,6 +12,13 @@ padding-left: 0; padding-right: 0; } + + &.-profile { + @media #{$bp4} { + border: 2px solid $text-color; + padding: g() - 2px; + } + } } .sidebar_header { @@ -23,6 +30,7 @@ } .sidebar_inner { + max-width: $line-width; padding-bottom: g(); position: relative; // For sticky sidebar transform: translate3d(0, 0, 0); // For sticky sidebar diff --git a/themes/fid_bbi/scss/blocks/table.scss b/themes/fid_bbi/scss/blocks/table.scss new file mode 100644 index 0000000000000000000000000000000000000000..c423dc757ea414bd4f0ecb3794abee8a63c30e39 --- /dev/null +++ b/themes/fid_bbi/scss/blocks/table.scss @@ -0,0 +1,96 @@ +// Reponsive tables +.table-resp-data-md { + display: block; + + @media #{$bp3} { + display: table; + } + + tbody { + display: block; + + @media #{$bp3} { + display: table-row-group; + } + } + + td { + display: block; + overflow: hidden; + padding: 0 0 0 g(5); + + @media #{$bp3} { + display: table-cell; + overflow: auto; + padding: g(.25) 0; + } + + &::before { + clear: left; + content: attr(data-title); + font-size: $font-size-small; + font-weight: bold; + float: left; + transform: translateY(1px); // account for smaller font size, match baseline of content + min-width: g(5); + margin-left: g(-5); + padding-right: g(.25); + + @media #{$bp3} { + content: none; + } + } + + + td { + @media #{$bp3} { + padding-left: g(.5); + } + } + } + + th { + display: block; + font-size: $font-size-small; + font-weight: bold; + + @media #{$bp3} { + display: table-cell; + padding: g(.25) 0; + } + + + td, + + th { + @media #{$bp3} { + padding-left: g(.5); + } + } + } + + tr:first-child th { + display: none; + + @media #{$bp3} { + display: table-cell; + } + } + + tr { + display: block; + box-shadow: 2px 0 $text-color inset; + padding-left: g(); + + @media #{$bp3} { + box-shadow: 0 -2px $text-muted-color inset; + display: table-row; + padding: 0; + } + + + tr { + margin-top: g(); + + @media #{$bp3} { + margin-top: 0; + } + } + } +} diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss index a2a3b9458a49f4a713628989125f4845cc70dfe9..6b5eca6950bfd4608aeee84041d71b588ae33d4a 100644 --- a/themes/fid_bbi/scss/compiled.scss +++ b/themes/fid_bbi/scss/compiled.scss @@ -25,6 +25,7 @@ @import 'blocks/badge'; @import 'blocks/border'; @import 'blocks/box'; +@import 'blocks/browse'; @import 'blocks/button'; @import 'blocks/container'; @import 'blocks/facet'; @@ -42,12 +43,12 @@ @import 'blocks/posts'; @import 'blocks/post'; @import 'blocks/record'; -@import 'blocks/required'; @import 'blocks/result'; @import 'blocks/results'; @import 'blocks/search'; @import 'blocks/sidebar'; @import 'blocks/sr-only'; +@import 'blocks/table'; @import 'blocks/tabs'; @import 'blocks/tagline'; @import 'blocks/toggle'; diff --git a/themes/fid_bbi/scss/mixins/paragraph.scss b/themes/fid_bbi/scss/mixins/paragraph.scss index 83e95700f9eb545af1d5d7685af4d50842a70692..a303ab4901fc55881e0bda0c01d7ee68c345f565 100644 --- a/themes/fid_bbi/scss/mixins/paragraph.scss +++ b/themes/fid_bbi/scss/mixins/paragraph.scss @@ -1,6 +1,7 @@ @mixin paragraph { margin: 0 auto g(); - max-width: g(30); + max-width: $line-width; + width: 100%; &:last-child { margin-bottom: 0; diff --git a/themes/fid_bbi/scss/util/hacks.scss b/themes/fid_bbi/scss/util/hacks.scss index d9c9686e2abbc8c1c83e796c02c562c06ea405b6..a39ee73178e23c1588b9a3d5609d314a2e2ddee5 100644 --- a/themes/fid_bbi/scss/util/hacks.scss +++ b/themes/fid_bbi/scss/util/hacks.scss @@ -3,13 +3,35 @@ // justify to recreate those templates. Instead, some CSS is applied to // Bootstrap classes. -// Last row of forms, containing a "cancel" link and the submit button -.form-group:last-child > .col-lg-11 { - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; - flex-direction: row-reverse; +// Active links in browse lists and profile menu sidebar +a.active { + color: $text-color; + position: relative; + + // triangle marker + &::before { + // off-canvas breakpoint + @media #{$bp4} { + background: $white; + content: ''; + display: block; + position: absolute; + width: 12px; + height: 12px; + border-left: 2px solid; + border-top: 2px solid; + top: 50%; + margin-top: -6px; + margin-left: g(-1) - 4.5px; + transform: rotate(135deg); + } + } +} + +// .container must be set on .main_wrap for the create-list modal JS to work +// but we don't want its styles +.container.main_wrap { + display: block; } .dropdown-menu { @@ -31,6 +53,7 @@ display: block; } + // TODO: Use code above from a.active &::before { background: $white; content: ''; @@ -38,8 +61,9 @@ position: absolute; width: 12px; height: 12px; - box-shadow: 2px 2px 0 $text-color inset; - top: -5px; // align with top + border-left: 2px solid; + border-top: 2px solid; + top: -5.5px; // align with top transform: rotate(45deg); } @@ -51,5 +75,32 @@ &::before { content: none; } + + + li { + margin-top: g(.25); + } } } + +// Last row of forms, containing a "cancel" link and the submit button +.form-group:last-child > .col-lg-11 { + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; + flex-direction: row-reverse; +} + +// .in-list is set via JS on the add-to-favorites button, fill the icon +.in-list { + .icon { + path { + fill: currentColor; + } + } +} + +// Togglable item list inside form +#itemhide { + width: 100%; +} diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml index c0ab69367872eaa964c431b4299a77ea07cea179..f6f5e3e4fb5fb0f74a5e00e905e85101473c0959 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml @@ -1,5 +1,16 @@ <!-- fid_bbi: RecordDriver - DefaultRecord - list-entry --> -<?php /*copied from finc */?> +<?php +/** + * Copied from themes/finc/templates/RecordDriver/DefaultRecord/list-entry.phtml + * FID BBI specific changes: + * - Clean up HTML, remove unused parts + * - Change result HTML to match result list + * - Add icons + * + * @author Tobias Schäfer <ts@aspectis.net> + */ +?> + <?php // Set up some convenience variables: $id = $this->driver->getUniqueId(); @@ -11,221 +22,284 @@ if (isset($this->list) && is_object($this->list)) { $list_id = null; $user_id = $this->user ? $this->user->id : null; } + // finc: next line finc-specific; required to display public favorites lists, #12052, see also below - CK $isEditable = $this->user && $this->user->id === $user_id; -// Thumbnail -$coverDetails = $this->record($this->driver)->getCoverDetails('list-entry', 'medium', $this->recordLink()->getUrl($this->driver)); -$cover = $coverDetails['html']; -$thumbnail = false; -$thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('list'); -if ($cover): - ob_start(); ?> - <div class="media-<?=$thumbnailAlignment?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>"> - <?=$cover?> - </div> - <?php $thumbnail = ob_get_contents(); ?> - <?php ob_end_clean(); ?> -<?php endif; ?> + +$account = $this->auth()->getManager(); +$format = ($this->driver->tryMethod('getFormats') ?? ['Unknown format'])[0]; +$formatIconMappingsFile = APPLICATION_PATH . '/themes/fid_bbi/format-icon-mappings.json'; +$formatIconMappings = json_decode(file_get_contents($formatIconMappingsFile), true); +$icon = $formatIconMappings[$format] ?? 'unknown'; +?> + <div class="result<?php if ($this->driver->supportsAjaxStatus()): ?> ajaxItem<?php endif ?>"> <input type="hidden" value="<?=$this->escapeHtmlAttr($id)?>" class="hiddenId"/> <input type="hidden" value="<?=$this->escapeHtmlAttr($source)?>" class="hiddenSource"/> - <?=$this->record($this->driver)->getCheckbox()?> - <div class="media"> - <?php if ($thumbnail && $thumbnailAlignment == 'left'): ?> - <?=$thumbnail?> - <?php endif; ?> - <div class="media-body"> - <div class="result-body"> - <div class="resultItemLine1"> - <?php $missing = $this->driver instanceof \VuFind\RecordDriver\Missing; ?> - <?php if (!$missing): ?><a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>"><?php endif; ?> - <span class="title"><?=$this->record($this->driver)->getTitleHtml()?></span> - <?php if (!$missing): ?></a><?php endif; ?> - </div> - <div class="resultItemLine2"> - <?php if ($this->driver->isCollection()): ?> - <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary()));?> - <?php else: ?> - <?php $summAuthors = $this->driver->getPrimaryAuthors(); - if (!empty($summAuthors)): ?> - <?=$this->transEsc('by')?> - <?php $authorCount = count($summAuthors); - foreach ($summAuthors as $i => $summAuthor): ?> - <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>"><?=$this->escapeHtml($summAuthor)?></a><?=($i + 1 < $authorCount ? ';' : '')?> - <?php endforeach; ?> - <?php endif; ?> + <div class="result_checkbox"> + <?=$this->record($this->driver)->getCheckbox()?> + </div> - <?php $journalTitle = $this->driver->getContainerTitle(); - $summDate = $this->driver->getPublicationDates(); ?> - <?php if (!empty($journalTitle)): ?> - <?=!empty($summAuthor) ? '<br/>' : ''?> - <?=/* TODO: handle highlighting more elegantly here */ - $this->transEsc('Published in') . ' <a href="' . $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle)) . '">' . $this->highlight($journalTitle) . '</a>';?> - <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate[0]) . ')' : ''?> - <?php elseif (!empty($summDate)): ?> - <?=!empty($summAuthor) ? '<br/>' : ''?> - <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?> - <?php endif; ?> - <?php $summInCollection = $this->driver->getContainingCollections(); - if (false && !empty($summInCollection)): ?> - <?php foreach ($summInCollection as $collId => $collText): ?> - <div> - <b><?=$this->transEsc("in_collection_label")?></b> - <a class="collectionLinkText" href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>"> - <?=$this->escapeHtml($collText)?> - </a> - </div> - <?php endforeach; ?> - <?php endif; ?> - <?php endif; ?> - </div> + <div class="result_details"> + <h3 class="result_title resultItemLine1"> + <?php $missing = $this->driver instanceof \VuFind\RecordDriver\Missing; ?> + <?php if (!$missing): ?> + <a + href="<?=$this->recordLink()->getUrl($this->driver)?>" + class="getFull" + data-view="<?=$this->params->getOptions()->getListViewOption()?>" + > + <?=$this->record($this->driver)->getTitleHtml()?> + </a> + <?php else: ?> + <?=$this->record($this->driver)->getTitleHtml()?> + <?php endif; ?> + </h3> - <div class="last"> - <?php if (!$this->driver->isCollection()) { - if ($snippet = $this->driver->getHighlightedSnippet()) { - if (!empty($snippet['caption'])) { - echo '<strong>' . $this->transEsc($snippet['caption']) . ':</strong> '; - } - if (!empty($snippet['snippet'])) { - echo '<span class="quotestart">“</span>...' . $this->highlight($snippet['snippet']) . '...<span class="quoteend">”</span><br/>'; - } - } - } ?> - - <?php /*fid_bbi #16050 and #16788*/ - $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags( - null, null, 'tag',$user_id - ) : array(); - ?> - - <?php $listNotes = $this->driver->getListNotes($list_id, $user_id); ?> - <?php if (count($listNotes) > 0): ?> - <strong><?=$this->transEsc('Notes')?>:</strong> - <?php if (count($listNotes) > 1): ?><br/><?php endif; ?> - <?php foreach ($listNotes as $note): ?> - <?=$this->escapeHtml($note)?><br/> - <?php endforeach; ?> - <?php endif; ?> + <div class="result_subtitle"> + <?php $subtitle = $this->record($this->driver)->getSubTitleHtml(6); ?> + <?php if (!empty($subtitle)): ?> + <?=$subtitle?> + <?php endif; ?> + </div> - <?php if (count($this->lists) > 0): ?> - <strong><?=$this->transEsc('Saved in')?>:</strong> - <?php $i = 0; - foreach ($this->lists as $current): ?> - <a href="<?=$this->url('userList', array('id' => $current->id))?>"><?=$this->escapeHtml($current->title)?></a><?php if ($i++ < count($this->lists) - 1): ?>,<?php endif; ?> + <div class="resultItemLine2"> + <?php if ($this->driver->isCollection()): ?> + <?=implode('<br>', array_map(array($this, 'escapeHtml'), $this->driver->getSummary()));?> + <?php else: ?> + <?php $summAuthors = $this->driver->getPrimaryAuthors(); ?> + <?php if (!empty($summAuthors)): ?> + <div class="result_author"> + <?php $authorCount = count($summAuthors); + foreach ($summAuthors as $i => $summAuthor): ?> + <a href="<?=$this->record($this->driver)->getLink('author', $summAuthor)?>"> + <?=$this->escapeHtml($summAuthor)?> + </a><?=($i + 1 < $authorCount ? ';' : '')?> <?php endforeach; ?> - <br/> - <?php endif; ?> + </div> + <?php endif; ?> + + <?php + $journalTitle = $this->driver->getContainerTitle(); + $summDate = $this->driver->getPublicationDates(); + ?> + <?php if (!empty($journalTitle)): ?> + <div> + <?=$this->transEsc('Published in')?> - <div class="callnumAndLocation ajax-availability hidden"> - <?php if ($this->driver->supportsAjaxStatus()): ?> - <strong class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</strong> - <span class="callnumber ajax-availability hidden"> - <?=$this->transEsc('Loading')?>...<br/> - </span> - <strong><?=$this->transEsc('Located')?>:</strong> - <span class="location ajax-availability hidden"> - <?=$this->transEsc('Loading')?>... - </span> - <div class="locationDetails"></div> - <?php else: ?> - <?php $summCallNo = $this->driver->getCallNumber(); - if (!empty($summCallNo)): ?> - <strong><?=$this->transEsc('Call Number')?>:</strong> <?=$this->escapeHtml($summCallNo)?> - <?php endif; ?> + <?php // TODO: Handle highlighting more elegantly ?> + <a href="<?=$this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle))?>"> + <?=$this->highlight($journalTitle)?> + </a> + + <?php if (!empty($summDate)): ?> + (<?=$this->escapeHtml($summDate[0])?>) <?php endif; ?> </div> + <?php elseif (!empty($summDate)): ?> + <div class="result_place"> + <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate[0])?> + </div> + <?php endif; ?> - <?php /* We need to find out if we're supposed to display an OpenURL link ($openUrlActive), - but even if we don't plan to display the link, we still want to get the $openUrl - value for use in generating a COinS (Z3988) tag -- see bottom of file. - */ - $openUrl = $this->openUrl($this->driver, 'results'); - $openUrlActive = $openUrl->isActive(); - $doi = $this->doi($this->driver, 'results'); - $doiActive = $doi->isActive(); - // Account for replace_other_urls setting - $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); - - if ($openUrlActive || $doiActive || !empty($urls)): - ?> - <?php if ($openUrlActive): ?> - <br/> - <?=$openUrl->renderTemplate()?> - <?php endif; ?> + <?php $summInCollection = $this->driver->getContainingCollections(); ?> + <?php if (false && !empty($summInCollection)): ?> + <?php foreach ($summInCollection as $collId => $collText): ?> + <div> + <b><?=$this->transEsc("in_collection_label")?></b> + <a + class="collectionLinkText" + href="<?=$this->url('collection', array('id' => $collId))?>?recordID=<?=urlencode($this->driver->getUniqueID())?>" + > + <?=$this->escapeHtml($collText)?> + </a> + </div> + <?php endforeach; ?> + <?php endif; ?> + <?php endif; ?> + </div> - <?php if ($doiActive): ?> - <br/> - <?=$doi->renderTemplate()?> + <div class="last"> + <?php if (!$this->driver->isCollection()): ?> + <?php if ($snippet = $this->driver->getHighlightedSnippet()): ?> + <?php if (!empty($snippet['caption'])): ?> + <?=$this->transEsc($snippet['caption'])?>: <?php endif; ?> - - <?php if (!is_array($urls)) { - $urls = []; - } - if (!$this->driver->isCollection()): - foreach ($urls as $current): ?> - <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext" target="new"><i class="fa fa-external-link" - aria-hidden="true"></i> <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?> - </a> - <?php endforeach; ?> - <?php endif; ?> + <?php if (!empty($snippet['snippet'])): ?> + <span class="quotestart">“</span> + …<?=$this->highlight($snippet['snippet'])?>… + <span class="quoteend">”</span> + <br> <?php endif; ?> - <br/> + <?php endif; ?> + <?php endif; ?> - <?=$this->record($this->driver)->getFormatList()?> + <?php $listNotes = $this->driver->getListNotes($list_id, $user_id); ?> + <?php if (count($listNotes) > 0): ?> + <?=$this->transEsc('Notes')?>: + <?php if (count($listNotes) > 1): ?><br><?php endif; ?> + <?php foreach ($listNotes as $note): ?> + <?=$this->escapeHtml($note)?><br> + <?php endforeach; ?> + <?php endif; ?> - <?php if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> - <span class="status ajax-availability hidden"><?=$this->transEsc('Loading')?>...</span> - <br/><br/> + <?php if (count($this->lists) > 0): ?> + <?=$this->transEsc('Saved in')?>: + <?php $i = 0; ?> + <?php foreach ($this->lists as $current): ?> + <a href="<?=$this->url('userList', array('id' => $current->id))?>"> + <?=$this->escapeHtml($current->title)?> + </a><?php if ($i++ < count($this->lists) - 1): ?>,<?php endif; ?> + <?php endforeach; ?> + <br> + <?php endif; ?> + + <div class="callnumAndLocation ajax-availability hidden"> + <?php if ($this->driver->supportsAjaxStatus()): ?> + <span class="hideIfDetailed"><?=$this->transEsc('Call Number')?>:</span> + <span class="callnumber ajax-availability hidden"> + <?=$this->transEsc('Loading')?>…<br> + </span> + <span><?=$this->transEsc('Located')?>:</span> + <span class="location ajax-availability hidden"> + <?=$this->transEsc('Loading')?>… + </span> + <div class="locationDetails"></div> + <?php else: ?> + <?php $summCallNo = $this->driver->getCallNumber(); + if (!empty($summCallNo)): ?> + <span><?=$this->transEsc('Call Number')?>:</span> <?=$this->escapeHtml($summCallNo)?> <?php endif; ?> - <?=$this->record($this->driver)->getPreviews()?> - </div> + <?php endif; ?> </div> - <div class="result-links hidden-print"> - <?php /* finc: next line finc-specific; required to display public favorites lists, #12052, see also above - CK */ ?> - <?php if ($isEditable): ?> - <i class="fa fa-fw fa-edit" aria-hidden="true"></i> <a - href="<?=$this->url('myresearch-edit')?>?id=<?=urlencode($id)?>&source=<?=urlencode($source)?><?php if (null !== $list_id): ?>&list_id=<?=urlencode($list_id)?><?php endif; ?>" - class="edit tool"><?=$this->transEsc('Edit')?></a><br/> - <?php /* Use a different delete URL if we're removing from a specific list or the overall favorites: */ - $deleteUrl = null === $list_id - ? $this->url('myresearch-favorites') - : $this->url('userList', ['id' => $list_id]); - $deleteUrlGet = $deleteUrl . '?delete=' . urlencode($id) . '&source=' . urlencode($source); - - $dLabel = 'delete-label-' . preg_replace('[\W]', '-', $id); - ?> - <div class="dropdown"> - <i class="fa fa-fw fa-trash-o" aria-hidden="true"></i> <a class="dropdown-toggle" id="<?=$dLabel?>" role="button" data-toggle="dropdown" href="<?=$deleteUrlGet?>"> - <?=$this->transEsc('Delete')?> - </a> - <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel?>"> - <li><a onClick="$.post('<?=$deleteUrl?>', {'delete':'<?=$this->escapeJs($id)?>','source':'<?=$this->escapeJs($source)?>','confirm':true},function(){location.reload(true)})" - title="<?=$this->transEsc('confirm_delete_brief')?>"><?=$this->transEsc('confirm_dialog_yes')?></a></li> - <li><a><?=$this->transEsc('confirm_dialog_no')?></a></li> - </ul> - </div> + <?php + // We need to find out if we're supposed to display an OpenURL link + // ($openUrlActive), but even if we don't plan to display the link, we + // still want to get the $openUrl value for use in generating a COinS + // (Z3988) tag -- see bottom of file. + $openUrl = $this->openUrl($this->driver, 'results'); + $openUrlActive = $openUrl->isActive(); + $doi = $this->doi($this->driver, 'results'); + $doiActive = $doi->isActive(); + // Account for replace_other_urls setting + $urls = $this->record($this->driver)->getLinkDetails($openUrlActive); + ?> - <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?> + <?php if ($openUrlActive || $doiActive || !empty($urls)): ?> + <?php if ($openUrlActive): ?> + <br> + <?=$openUrl->renderTemplate()?> <?php endif; ?> - </div> - </div> - <?php /*fid_bbi #16050*/ if (!empty($listTags)): ?> - <strong><?=$this->transEsc('Your Tags')?>:</strong> - <?php foreach ($listTags as $tag): ?> - <?php /* filter for own tags, cf. #17354, DM */?> - <?php if ($tag['is_me'] ?? false): ?> - <a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet('tags', $tag->tag)?>"><?=$this->escapeHtml($tag->tag)?></a> - <?php endif;?> + <?php if ($doiActive): ?> + <br> + <?=$doi->renderTemplate()?> + <?php endif; ?> + + <?php + if (!is_array($urls)) { + $urls = []; + } + ?> + + <?php if (!$this->driver->isCollection()): ?> + <?php foreach ($urls as $index => $current): ?> + <?php // NOTE: Do not insert whitespace behind <a> here ?> + <a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>" class="fulltext"> + <?=($current['url'] == $current['desc']) ? $this->transEsc('Get full text') : $this->escapeHtml($current['desc'])?></a><?php if ($index < count($urls) - 1): ?>, <?php endif; ?> <?php endforeach; ?> - <br/> + <?php endif; ?> + <?php endif; ?> + + <div class="result_media"> + <?=$this->record($this->driver)->getFormatList()?> + </div> + + <?php if (!$openUrlActive && empty($urls) && $this->driver->supportsAjaxStatus()): ?> + <div class="status ajax-availability hidden"><?=$this->transEsc('Loading')?>…</div> <?php endif; ?> - <?php if ($thumbnail && $thumbnailAlignment == 'right'): ?> - <?=$thumbnail?> + <?=$this->record($this->driver)->getPreviews()?> + </div> + + <?php + // fid_bbi #16050 + $listTags = ($this->usertags()->getMode() !== 'disabled') + ? $this->driver->getTags(null, null, 'tag', $user_id) + : []; + ?> + <?php if (!empty($listTags)): ?> + <div> + <?=$this->transEsc('Your Tags')?>: + <?php foreach ($listTags as $tag): ?> + <?php // filter for own tags, cf. #17354, DM ?> + <?php if ($tag['is_me'] ?? false): ?> + <a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet('tags', $tag->tag)?>"> + <?=$this->escapeHtml($tag->tag)?> + </a> + <?php endif;?> + <?php endforeach; ?> + </div> + <?php endif; ?> + </div> + + <div class="result_actions"> + <?php + // finc: next line finc-specific; required to display public favorites + // lists, #12052, see also above - CK + ?> + <?php if ($isEditable): ?> + <a + href="<?=$this->url('myresearch-edit')?>?id=<?=urlencode($id)?>&source=<?=urlencode($source)?><?=$list_id !== null ? '&list_id=' . urlencode($list_id) : ''?>" + class="edit tool" + > + <?=$this->icon('small/pen')?> + <div class="tooltip"> + <?=$this->transEsc('Edit')?> + </div> + </a> + + <?php + // Use a different delete URL if we're removing from a specific list or + // the overall favorites: + $deleteUrl = null === $list_id + ? $this->url('myresearch-favorites') + : $this->url('userList', ['id' => $list_id]); + $deleteUrlGet = $deleteUrl . '?delete=' . urlencode($id) . '&source=' . urlencode($source); + $dLabel = 'delete-label-' . preg_replace('[\W]', '-', $id); + ?> + <div class="dropdown"> + <a class="dropdown-toggle" id="<?=$dLabel?>" role="button" data-toggle="dropdown" href="<?=$deleteUrlGet?>"> + <?=$this->icon('small/trash')?> + <div class="tooltip"> + <?=$this->transEsc('Delete')?> + </div> + </a> + + <ul class="dropdown-menu" role="menu" aria-labelledby="<?=$dLabel?>"> + <li> + <a + onClick="$.post('<?=$deleteUrl?>', {'delete':'<?=$this->escapeJs($id)?>','source':'<?=$this->escapeJs($source)?>','confirm':true},function(){location.reload(true)})" + title="<?=$this->transEsc('confirm_delete_brief')?>" + > + <?=$this->transEsc('confirm_dialog_yes')?> + </a> + </li> + <li> + <?php // TODO: <a> without href? ?> + <a> + <?=$this->transEsc('confirm_dialog_no')?> + </a> + </li> + </ul> + </div> + + <?php if ($this->driver->supportsCoinsOpenUrl()): ?> + <span class="Z3988" title="<?=$this->escapeHtmlAttr($this->driver->getCoinsOpenUrl())?>"></span> + <?php endif; ?> <?php endif; ?> </div> </div> -<!-- fid_bbi: RecordDriver - DefaultRecord - list-entry - END --> \ No newline at end of file +<!-- fid_bbi: RecordDriver - DefaultRecord - list-entry - END --> diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml index 6c4e1981d3a8091ce0d0f70b338c335d9979c999..7fb326565b24fe8b4c3008999d9033f7591dd2f2 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml @@ -171,12 +171,13 @@ $formatIconMappings = json_decode(file_get_contents($formatIconMappingsFile), tr <?php if ($this->userlist()->getMode() !== 'disabled'): ?> <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?> + <?php // NOTE: id is required for setting `in-list` class via JS ?> <a + id="fav-icon<?=$this->driver->getUniqueId()?>" href="<?=$this->recordLink()->getActionUrl($this->driver, 'Save')?>" data-lightbox class="save-record result-link-label" data-id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>" - title="<?=$this->transEsc('Add to favorites')?>" > <?=$this->icon('small/star')?> <div class="tooltip"> diff --git a/themes/fid_bbi/templates/browse/home.phtml b/themes/fid_bbi/templates/browse/home.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b609b1b10239f0fdddf281c585f6f6ae83a75f2a --- /dev/null +++ b/themes/fid_bbi/templates/browse/home.phtml @@ -0,0 +1,129 @@ +<!-- fid_bbi: - templates - browse - home --> +<?php +/** + * Based on themes/finc/templates/browse/home.phtml, which was copied from + * themes/bootstrap3/templates/browse/home.phtml + * + * Changes specific to FID BBI: + * - Show current action in title + * - Use actual lists + * - Remove unused icons + * + * @author: Tobias Schäfer <ts@aspectis.net> + */ +?> + +<?php +$this->headTitle($this->translate('Browse') . ": $this->currentAction"); +$BROWSE_BASE = $this->url('browse-' . strtolower($this->currentAction)); +$SEARCH_BASE = $this->url($this->currentAction == 'Tag' ? 'tag-home' : 'search-results'); +?> + +<h1><?=$this->translate('Browse') . ": $this->currentAction"?></h1> + +<?php if (!isset($this->currentAction)): ?> + <p><?=$this->translate('Choose a Category to Begin Browsing') ?>:</p> +<?php endif; ?> + +<div class="browse"> + <ul id="list1" class="unstyled-list"> + <?php foreach ($this->browseOptions as $item => $currentOption): ?> + <li> + <a + href="<?=$this->url('browse-' . strtolower($currentOption['action'])); ?>" + class="browse-item <?=($currentOption['action'] === $this->currentAction) ? 'active' : ''?>" + > + <?=$this->transEsc($currentOption['description']) ?> + </a> + </li> + <?php endforeach; ?> + </ul> + + <?php if (!empty($this->categoryList)): ?> + <ul id="list2" class="unstyled-list"> + <?php foreach($this->categoryList as $findby => $category): ?> + <li> + <a + href="<?=$BROWSE_BASE ?>?findby=<?=urlencode($findby) ?>&query_field=<?=$this->browse()->getSolrField($findby, $this->currentAction) ?>" + class="browse-item <?=($this->findby == $findby) ? 'active' : ''?>" + > + <?php if(is_string($category)): ?> + <?=$this->transEsc($category)?> + <?php else: ?> + <?=$this->transEsc($category['text'])?> + (<?=number_format($category['count'])?>) + <?php endif; ?> + </a> + </li> + <?php endforeach; ?> + </ul> + <?php endif; ?> + + <?php if (!empty($this->secondaryList)): ?> + <ul id="list3" class="unstyled-list"> + <?php foreach($this->secondaryList as $secondary): ?> + <?php + $url = $BROWSE_BASE . '?findby=' . urlencode($this->findby) + . '&category=' . urlencode($this->category) + . '&query=' . urlencode($secondary['value']); + + if ($this->facetPrefix) { + $url .= '&facet_prefix=' . urlencode($secondary['displayText']); + } + + if ($this->secondaryParams) { + foreach($this->secondaryParams as $var => $val) { + $url .= '&' . $var . '=' . urlencode($val); + } + } + + $viewRecord = !empty($this->categoryList) && $this->currentAction != 'Tag' && $this->findby != 'alphabetical'; + $hasBadge = $this->findby != 'alphabetical' && isset($secondary['count']); + ?> + <li> + <a + href="<?=$url ?>" + class="<?=($this->query === $secondary['value'] . '' || $this->query === $secondary['value'] . '*') ? 'active' : ''?>" + > + <?=$this->escapeHtml($secondary['displayText']) ?> + <?php if ($hasBadge): ?> + (<?=number_format($secondary['count'])?>) + <?php endif; ?> + </a> + </li> + + <?php if ($viewRecord): ?> + <li> + <a + class="browse-item view-record" + href="<?=$SEARCH_BASE?>?lookfor=<?php if ($this->filter): ?>&filter[]=<?=urlencode($this->filter) ?>%3A<?=str_replace('+AND+', '&filter[]=', urlencode($secondary['value'])) ?><?php endif; ?>&filter[]=<?=$this->browse()->getSolrField($this->currentAction) ?>%3A[* TO *]<?php if($this->dewey_flag): ?>&sort=dewey-sort<?php endif; ?>" + > + <?=$this->translate('View Records')?> + </a> + </li> + <?php endif; ?> + <?php endforeach; ?> + </ul> + <?php endif; ?> + + <?php if (!empty($this->resultList)): ?> + <ul id="list4" class="unstyled-list"> + <?php foreach($this->resultList as $result): ?> + <li> + <a + class="browse-item with-badge" + href="<?=$SEARCH_BASE ?>?<?=$this->paramTitle ?><?=urlencode($result['value']) ?><?php if ($this->searchParams): foreach($this->searchParams as $var => $val): ?>&<?=$var ?>=<?=urlencode($val) ?><?php endforeach;endif; ?>" + > + <?=$this->escapeHtml($result['displayText'])?> + (<?=number_format($result['count'])?>) + </a> + </li> + <?php endforeach; ?> + </ul> + <?php elseif (isset($this->query)): ?> + <ul id="list4" class="unstyled-list"> + <li><?=$this->translate('nohit_heading')?></li> + </ul> + <?php endif; ?> +</div> +<!-- fid_bbi - templates - browse - home - END --> diff --git a/themes/fid_bbi/templates/fid/user/password-reset.phtml b/themes/fid_bbi/templates/fid/user/password-reset.phtml new file mode 100644 index 0000000000000000000000000000000000000000..22e6542bda2271fbc06ddc41ec050ad59b932dda --- /dev/null +++ b/themes/fid_bbi/templates/fid/user/password-reset.phtml @@ -0,0 +1,87 @@ +<?php +/** + * Copyright (C) 2019 Leipzig University Library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Robert Lange <lange@ub.uni-leipzig.de> + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @author Tobias Schäfer <ts@aspectis.net> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSubmit; +use Zend\I18n\Translator\TranslatorInterface; + +/** @var FormLabel $formLabel */ +$formLabel = $this->formLabel(); +/**@var FormSubmit $formSubmit */ +$formSubmit = $this->formSubmit(); +/** @var FormElementErrors $formElementErrors */ +$formElementErrors = $this->formElementErrors(); + +$formLabel->setTranslatorTextDomain('fid'); +$formSubmit->setTranslatorTextDomain('fid'); +$formElementErrors->setTranslatorTextDomain('fid'); +/** @var TranslatorInterface $translator */ +$translator = $this->getHelperPluginManager()->get('translate')->getTranslator(); +$formLabel->setTranslator($translator); +$formElementErrors->setTranslator($translator); + +/** @var Form $form */ +$form = $this->form; +$form->setAttribute('method', 'post'); +$form->setAttribute('action', $this->url('fid/user/reset-password')); +$form->prepare(); + +$this->headTitle($this->translate("fid::password_reset_form_title")); +?> + +<h1><?=$this->translate("fid::password_reset_form_title")?></h1> + +<?=$this->flashmessages()?> + +<p><?=$this->translate("fid::password_reset_form_information")?></p> + +<?=$this->form()->openTag($form)?> + +<?php +/** @var Element\Text $elemUsername */ +$elemUsername = $form->get('username'); +$elemUsername->setLabelAttributes(['class' => 'control-label']); +$elemUsername->setAttributes(['class' => 'form-control']); +?> +<div class="form-group"> + <?=$this->formLabel($elemUsername)?> + <?=$this->formElement($elemUsername)?> + <?=$this->formElementErrors($elemUsername)?> +</div> + +<?php +/** @var Element\Submit $elemSubmit */ +$elemSubmit = $form->get('submit'); +$elemSubmit->setAttributes(['class' => 'btn btn-primary']); +?> +<div class="form-group"> + <a class="back-to-login btn btn-link" href="<?=$this->url('myresearch-userlogin') ?>"> + <i class="fa fa-chevron-left" aria-hidden="true"></i> + <span class="decorate"><?=$this->transEsc('Back')?></span> + </a> + <?=$this->formElement($elemSubmit)?> +</div> +<?=$this->form()->closeTag($form)?> diff --git a/themes/fid_bbi/templates/fid/user/terms-de.phtml b/themes/fid_bbi/templates/fid/user/terms-de.phtml index fe343d386571f3cff3e7f63883a1d6ac3a463be3..4a163baf5138274123fa34e4936bff07896cbf5d 100644 --- a/themes/fid_bbi/templates/fid/user/terms-de.phtml +++ b/themes/fid_bbi/templates/fid/user/terms-de.phtml @@ -1,19 +1,15 @@ -<div class="bbi-terms"> - <br /> - <h2><strong>Nutzungsbedingungen</strong></h2> - <P>Der Fachinformationsdienst Buch-, Bibliotheks- und Informationswissenschaft (FID BBI) wird von der Herzog August Bibliothek Wolfenbüttel und der Universitätsbibliothek Leipzig betrieben und im Rahmen des Förderprogramms „Fachinformationsdienste für die Wissenschaft“ von der Deutschen Forschungsgemeinschaft (DFG) gefördert. Der FID BBI richtet sich entsprechend des Förderprogramms an Wissenschaftlerinnen und Wissenschaftler deutscher Einrichtungen der beteiligten sowie angrenzenden Disziplinen und stellt ihre bedarfsorientierte Versorgung mit sowie den schnellen und möglichst direkten Zugriff auf Spezialliteratur und forschungsrelevanten Informationen sicher.</P> - <p>Mit der Nutzung des Portals erklären Sie sich mit den Nutzungsbedingungen und der Datenschutzerklärung einverstanden.</p> - <ol> - <li>Für die Suche im Katalog des FID BBI ist keine vorherige Anmeldung oder Registrierung notwendig. Um jedoch alle Funktionen des Portals nutzen zu können, ist eine Registrierung erforderlich. Die Registrierung und die Inanspruchnahme der Dienstleistungen sind kostenfrei.</li> - <li>Bei der Registrierung müssen Sie persönliche Daten angeben, um Dienstleistungen in Anspruch nehmen zu können. Wir behandeln diese Daten gemäß unserer <a href="<?=$this->url('fid/user/policy')?>">Datenschutzerklärung</a>. Sie sind verpflichtet, Ihre Daten stets auf dem aktuellen Stand zu halten. Ein Nutzerkonto ist personengebunden; eine Weitergabe von Benutzername und Passwort ist nicht statthaft. Sie sind für alle Aktivitäten, für die Ihr Konto angemeldet ist, verantwortlich. Jede unbefugte Nutzung führt zu einer vorübergehenden oder dauerhaften Sperrung Ihres Kontos. Sie verpflichten sich, den FID BBI (fid(at)hab.de) unverzüglich zu informieren, wenn Ihnen eine solche unbefugte Nutzung bekannt wird.</li> - <li>Mit der Registrierung versichern Sie, der von Ihnen angegebenen Nutzergruppe zugehörig zu sein. FID BBI verfügt über zwei Nutzergruppen: Nutzergruppe I umfasst alle wissenschaftlichen Mitarbeitenden und Hochschullehrenden, die an einer Hochschule oder Forschungseinrichtung und in den für die Buch-, Bibliotheks- und Informationswissenschaft relevanten Fächern tätig sind, alle Mitglieder der einschlägigen Fachgesellschaften, Doktorand*innen, Stipendiat*innen sowie Wissenschaftler*innen, ohne Zugehörigkeit zu definierten Institutionen. Nutzergruppe II umfasst Studierende und sonstige Nutzende. Die endgültige Entscheidung, welcher Nutzergruppe Sie zugeordnet werden, obliegt dem FID BBI.</li> - <li>Die Registrierung ist nicht auf die primär adressierten Fachwissenschaftler*innen der Buch-, Bibliotheks- und Informationswissenschaft beschränkt. Der Zugriff auf einzelne Lizenzen kann jedoch Einschränkungen unterliegen. </li> - <li>Mit dem Abschluss der Registrierung verpflichten Sie sich, die angebotenen Dienstleistungen nicht missbräuchlich zu nutzen und alle lizenz- und urheberrechtlichen Bedingungen zu beachten (z.B. bei der Vervielfältigung oder Weitergabe von urheberrechtlich geschützten Werken, insbesondere auch bei frei verfügbaren Internetressourcen und/oder Open Access-Dokumenten).</li> - <li>Durch den FID BBI bereitgestellte E-Books und z.B. über den Dokumentenlieferdienst per Mail oder Ausdruck für Sie bereitgestellte Zeitschriftenartikel sowie Inhalte aus speziell lizenzierten Quellen (z.B. Datenbanken) dürfen nur für den eigenen Gebrauch abgerufen werden. Eine Vervielfältigung (insbesondere durch Speicherung in andere Netze oder Datenbanken) ist nicht zulässig.</li> - <li>Bei der Nutzung von Daten aus für den FID BBI lizenzierten Datenbanken versichern Sie, die Daten ausschließlich im Rahmen Ihrer Forschung zu verwenden und nicht an Dritte weiterzugeben sowie die Daten nur für nicht-kommerzielle Zwecke zu verwerten. Es ist nicht gestattet, Daten aus Datenbanken mittels Bots (oder ähnlicher technischer Hilfsmittel) automatisiert abzurufen.</li> - <li>Wir behalten uns das Recht vor, einzelne oder alle Dienstleistungen nur für bestimmte Nutzergruppen anzubieten oder jederzeit ohne vorherige Ankündigung einzustellen. Wir behalten uns außerdem das Recht vor, Nutzerkonten bei wiederholter oder andauernder missbräuchlicher Nutzung vorübergehend oder ständig zu sperren.</li> - <li>Diese Nutzungsbedingungen und die Datenschutzerklärung können jederzeit durch den FID BBI geändert werden. Diese Änderungen werden registrierten Nutzenden rechtzeitig zur Kenntnis gebracht.</li> - </ol> - <br /> - <p>Stand 28.06.2019</p> -</div> \ No newline at end of file +<h1>Nutzungsbedingungen</h1> +<P>Der Fachinformationsdienst Buch-, Bibliotheks- und Informationswissenschaft (FID BBI) wird von der Herzog August Bibliothek Wolfenbüttel und der Universitätsbibliothek Leipzig betrieben und im Rahmen des Förderprogramms „Fachinformationsdienste für die Wissenschaft“ von der Deutschen Forschungsgemeinschaft (DFG) gefördert. Der FID BBI richtet sich entsprechend des Förderprogramms an Wissenschaftlerinnen und Wissenschaftler deutscher Einrichtungen der beteiligten sowie angrenzenden Disziplinen und stellt ihre bedarfsorientierte Versorgung mit sowie den schnellen und möglichst direkten Zugriff auf Spezialliteratur und forschungsrelevanten Informationen sicher.</P> +<p>Mit der Nutzung des Portals erklären Sie sich mit den Nutzungsbedingungen und der Datenschutzerklärung einverstanden.</p> +<ol> + <li>Für die Suche im Katalog des FID BBI ist keine vorherige Anmeldung oder Registrierung notwendig. Um jedoch alle Funktionen des Portals nutzen zu können, ist eine Registrierung erforderlich. Die Registrierung und die Inanspruchnahme der Dienstleistungen sind kostenfrei.</li> + <li>Bei der Registrierung müssen Sie persönliche Daten angeben, um Dienstleistungen in Anspruch nehmen zu können. Wir behandeln diese Daten gemäß unserer <a href="<?=$this->url('fid/user/policy')?>">Datenschutzerklärung</a>. Sie sind verpflichtet, Ihre Daten stets auf dem aktuellen Stand zu halten. Ein Nutzerkonto ist personengebunden; eine Weitergabe von Benutzername und Passwort ist nicht statthaft. Sie sind für alle Aktivitäten, für die Ihr Konto angemeldet ist, verantwortlich. Jede unbefugte Nutzung führt zu einer vorübergehenden oder dauerhaften Sperrung Ihres Kontos. Sie verpflichten sich, den FID BBI (fid(at)hab.de) unverzüglich zu informieren, wenn Ihnen eine solche unbefugte Nutzung bekannt wird.</li> + <li>Mit der Registrierung versichern Sie, der von Ihnen angegebenen Nutzergruppe zugehörig zu sein. FID BBI verfügt über zwei Nutzergruppen: Nutzergruppe I umfasst alle wissenschaftlichen Mitarbeitenden und Hochschullehrenden, die an einer Hochschule oder Forschungseinrichtung und in den für die Buch-, Bibliotheks- und Informationswissenschaft relevanten Fächern tätig sind, alle Mitglieder der einschlägigen Fachgesellschaften, Doktorand*innen, Stipendiat*innen sowie Wissenschaftler*innen, ohne Zugehörigkeit zu definierten Institutionen. Nutzergruppe II umfasst Studierende und sonstige Nutzende. Die endgültige Entscheidung, welcher Nutzergruppe Sie zugeordnet werden, obliegt dem FID BBI.</li> + <li>Die Registrierung ist nicht auf die primär adressierten Fachwissenschaftler*innen der Buch-, Bibliotheks- und Informationswissenschaft beschränkt. Der Zugriff auf einzelne Lizenzen kann jedoch Einschränkungen unterliegen. </li> + <li>Mit dem Abschluss der Registrierung verpflichten Sie sich, die angebotenen Dienstleistungen nicht missbräuchlich zu nutzen und alle lizenz- und urheberrechtlichen Bedingungen zu beachten (z.B. bei der Vervielfältigung oder Weitergabe von urheberrechtlich geschützten Werken, insbesondere auch bei frei verfügbaren Internetressourcen und/oder Open Access-Dokumenten).</li> + <li>Durch den FID BBI bereitgestellte E-Books und z.B. über den Dokumentenlieferdienst per Mail oder Ausdruck für Sie bereitgestellte Zeitschriftenartikel sowie Inhalte aus speziell lizenzierten Quellen (z.B. Datenbanken) dürfen nur für den eigenen Gebrauch abgerufen werden. Eine Vervielfältigung (insbesondere durch Speicherung in andere Netze oder Datenbanken) ist nicht zulässig.</li> + <li>Bei der Nutzung von Daten aus für den FID BBI lizenzierten Datenbanken versichern Sie, die Daten ausschließlich im Rahmen Ihrer Forschung zu verwenden und nicht an Dritte weiterzugeben sowie die Daten nur für nicht-kommerzielle Zwecke zu verwerten. Es ist nicht gestattet, Daten aus Datenbanken mittels Bots (oder ähnlicher technischer Hilfsmittel) automatisiert abzurufen.</li> + <li>Wir behalten uns das Recht vor, einzelne oder alle Dienstleistungen nur für bestimmte Nutzergruppen anzubieten oder jederzeit ohne vorherige Ankündigung einzustellen. Wir behalten uns außerdem das Recht vor, Nutzerkonten bei wiederholter oder andauernder missbräuchlicher Nutzung vorübergehend oder ständig zu sperren.</li> + <li>Diese Nutzungsbedingungen und die Datenschutzerklärung können jederzeit durch den FID BBI geändert werden. Diese Änderungen werden registrierten Nutzenden rechtzeitig zur Kenntnis gebracht.</li> +</ol> +<p>Stand 28.06.2019</p> diff --git a/themes/fid_bbi/templates/fid/user/terms-en.phtml b/themes/fid_bbi/templates/fid/user/terms-en.phtml index ebf73653c3299f13087bcef457a9352e1383cf0e..1df10bc416639af1bbe45f0c3127bd5b11b79376 100644 --- a/themes/fid_bbi/templates/fid/user/terms-en.phtml +++ b/themes/fid_bbi/templates/fid/user/terms-en.phtml @@ -1,21 +1,17 @@ -<div class="bbi-terms"> - <br /> - <h2><strong>Terms of Use</strong></h2> - <p>Please note: The English version of our terms of is for informational purposes only. - The German version shall be legally binding only.</p> - <P>The Specialised Information Service for book studies, library and information science (FID BBI) is operated by the Herzog August Bibliothek Wolfenbüttel and Leipzig University Library and is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) within the programme "Specialised Information Services." In accordance with the programme, FID BBI is aimed at researchers residing in Germany from the participating and related disciplines to ensure that they are provided with a fast and direct access to specialist literature and research-relevant information. This is a demand orientated service.</p> - <p>The use of the Website is subject to the following Terms of Use and Privacy Policy, which you accept by using the Website.</P> - <ol> - <li>No registration or login is required for searching the catalogue of the FID-BBI-portal. However, in order to be able to use all services, you have to register for an account. Account registration and use of the services are free of charge.</li> - <li>You are required to provide certain personal details when registering for an account. Our <a href="<?=$this->url('fid/user/policy')?>">privacy policy</a> applies. You agree to provide true, accurate, current, and complete information about yourself as prompted by the registration form. You also agree to maintain and promptly update your personal details. A user account is assigned to a single person. You must not reveal user name and password to a third party. You are fully responsible for all activities that occur on your account. Any unauthorised use will cause a temporary or permanent blocking of your account. You agree to immediately notify FID BBI (fid(at)hab.de) if you become aware of any such unauthorised use of your account.</li> - <li>During the registration process you have to choose a membership level. There are two membership levels: Group I includes all researchers and university lecturers of the relevant disciplines employed at a university or research institution, all members of the relevant specialist associations, doctoral students , scholarship holders as well as researchers in book studies or library and information sciences with no formal employment at a university or research institution. Group II includes students and other users. We may re-assign you to another membership level at our discretion.</li> - <li>Registering with the FID BBI is not restricted to researchers of book studies, library and information sciences. However, access to individual licenses may be subject to restrictions.</li> - <li>By completing the registration, you agree not to misuse the services offered and to respect all copyrights (e.g. when reproducing or passing on material that is in in copyright, particularly when it is freely available Internet resources and / or Open Access documents).</li> - <li>E-resources provided by FID BBI and other documents delivered to you by FID BBI (either electronically or physically) are for your own personal use only. Any duplication or copying is prohibited.</li> - <li>When obtaining data from databases licensed by FID BBI, you assure that you use the data only for your research and you agree not to forward any data to third parties. You may use data for non-commercial purposes only. It is not permitted to retrieve data from databases using automated bots (or similar tools).</li> - <li>We reserve the right to restrict some or all services for certain user groups or to discontinue them for some or all services without notice at any time without prior notice. We also reserve the right to temporarily or permanently disable user accounts in the event of repeated or persistent abusive use.</li> - <li>The terms of use and privacy policy can be changed at any time by the FID BBI. These changes will be brought to the attention of registered users in a timely manner.</li> - </ol> - <br /> - <p>Last updated June 28, 2019</p> -</div> \ No newline at end of file +<h1>Terms of Use</h1> +<p>Please note: The English version of our terms of is for informational purposes only. + The German version shall be legally binding only.</p> +<P>The Specialised Information Service for book studies, library and information science (FID BBI) is operated by the Herzog August Bibliothek Wolfenbüttel and Leipzig University Library and is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) within the programme "Specialised Information Services." In accordance with the programme, FID BBI is aimed at researchers residing in Germany from the participating and related disciplines to ensure that they are provided with a fast and direct access to specialist literature and research-relevant information. This is a demand orientated service.</p> +<p>The use of the Website is subject to the following Terms of Use and Privacy Policy, which you accept by using the Website.</P> +<ol> + <li>No registration or login is required for searching the catalogue of the FID-BBI-portal. However, in order to be able to use all services, you have to register for an account. Account registration and use of the services are free of charge.</li> + <li>You are required to provide certain personal details when registering for an account. Our <a href="<?=$this->url('fid/user/policy')?>">privacy policy</a> applies. You agree to provide true, accurate, current, and complete information about yourself as prompted by the registration form. You also agree to maintain and promptly update your personal details. A user account is assigned to a single person. You must not reveal user name and password to a third party. You are fully responsible for all activities that occur on your account. Any unauthorised use will cause a temporary or permanent blocking of your account. You agree to immediately notify FID BBI (fid(at)hab.de) if you become aware of any such unauthorised use of your account.</li> + <li>During the registration process you have to choose a membership level. There are two membership levels: Group I includes all researchers and university lecturers of the relevant disciplines employed at a university or research institution, all members of the relevant specialist associations, doctoral students , scholarship holders as well as researchers in book studies or library and information sciences with no formal employment at a university or research institution. Group II includes students and other users. We may re-assign you to another membership level at our discretion.</li> + <li>Registering with the FID BBI is not restricted to researchers of book studies, library and information sciences. However, access to individual licenses may be subject to restrictions.</li> + <li>By completing the registration, you agree not to misuse the services offered and to respect all copyrights (e.g. when reproducing or passing on material that is in in copyright, particularly when it is freely available Internet resources and / or Open Access documents).</li> + <li>E-resources provided by FID BBI and other documents delivered to you by FID BBI (either electronically or physically) are for your own personal use only. Any duplication or copying is prohibited.</li> + <li>When obtaining data from databases licensed by FID BBI, you assure that you use the data only for your research and you agree not to forward any data to third parties. You may use data for non-commercial purposes only. It is not permitted to retrieve data from databases using automated bots (or similar tools).</li> + <li>We reserve the right to restrict some or all services for certain user groups or to discontinue them for some or all services without notice at any time without prior notice. We also reserve the right to temporarily or permanently disable user accounts in the event of repeated or persistent abusive use.</li> + <li>The terms of use and privacy policy can be changed at any time by the FID BBI. These changes will be brought to the attention of registered users in a timely manner.</li> +</ol> +<p>Last updated June 28, 2019</p> diff --git a/themes/fid_bbi/templates/fid/user/username-change.phtml b/themes/fid_bbi/templates/fid/user/username-change.phtml new file mode 100644 index 0000000000000000000000000000000000000000..919c7eaa878742e7ca8d3e8c3f0a80a9cafc5689 --- /dev/null +++ b/themes/fid_bbi/templates/fid/user/username-change.phtml @@ -0,0 +1,100 @@ +<?php +/** + * Copyright (C) 2019 Leipzig University Library + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * @author Gregor Gawol <gawol@ub.uni-leipzig.de> + * @author Sebastian Kehr <kehr@ub.uni-leipzig.de> + * @author Tobias Schäfer <ts@aspectis.net> + * @license http://opensource.org/licenses/gpl-2.0.php GNU GPLv2 + */ + +use Zend\Form\Element; +use Zend\Form\Form; +use Zend\Form\View\Helper\FormElementErrors; +use Zend\Form\View\Helper\FormLabel; +use Zend\Form\View\Helper\FormSubmit; +use Zend\I18n\Translator\TranslatorInterface; + +/** @var FormLabel $formLabel */ +$formLabel = $this->formLabel(); +/**@var FormSubmit $formSubmit */ +$formSubmit = $this->formSubmit(); +/** @var FormElementErrors $formElementErrors */ +$formElementErrors = $this->formElementErrors(); + +$formLabel->setTranslatorTextDomain('fid'); +$formSubmit->setTranslatorTextDomain('fid'); +$formElementErrors->setTranslatorTextDomain('fid'); +/** @var TranslatorInterface $translator */ +$translator = $this->getHelperPluginManager()->get('translate')->getTranslator(); +$formLabel->setTranslator($translator); +$formElementErrors->setTranslator($translator); + +/** @var Form $form */ +$form = $this->form; +$form->setAttribute('method', 'post'); +$form->setAttribute('action', $this->url('fid/user/change-username')); +$form->setAttribute('class', 'registration'); +$form->prepare(); + +$this->headTitle($this->translate("fid::username_change_form_title")); +?> + +<h1><?=$this->translate("fid::username_change_form_title")?></h1> + +<?=$this->flashmessages()?> + +<p><?=$this->translate("fid::username_change_form_information")?></p> + +<?=$this->form()->openTag($form)?> + +<?php +/** @var Element\Text $elemUsername */ +$elemUsername = $form->get('username'); +$elemUsername->setLabelAttributes(['class' => 'control-label']); +$elemUsername->setAttributes(['class' => 'form-control']); +?> +<div class="form-group"> + <?=$this->formLabel($elemUsername)?> + <?=$this->formElement($elemUsername)?> + <?=$this->formElementErrors($elemUsername)?> +</div> + +<?php +/** @var Element\Text $elemUsernameConfirmation */ +$elemUsernameConfirmation = $form->get('usernameConfirmation'); +$elemUsernameConfirmation->setLabelAttributes(['class' => 'control-label']); +$elemUsernameConfirmation->setAttributes(['class' => 'form-control']); +?> +<div class="form-group"> + <?=$this->formLabel($elemUsernameConfirmation)?> + <?=$this->formElement($elemUsernameConfirmation)?> + <?=$this->formElementErrors($elemUsernameConfirmation)?> +</div> + +<?php +/** @var Element\Submit $elemSubmit */ +$elemSubmit = $form->get('submit'); +$elemSubmit->setAttributes(['class' => 'btn btn-primary']); +?> +<div class="form-group"> + <a class="back-to-login btn btn-link" href="<?=$this->url('myresearch-userlogin')?>"> + <i class="fa fa-chevron-left" aria-hidden="true"></i> + <span class="decorate"><?=$this->transEsc('Back')?></span> + </a> + <?=$this->formElement($elemSubmit)?> +</div> +<?=$this->form()->closeTag($form)?> diff --git a/themes/fid_bbi/templates/header.phtml b/themes/fid_bbi/templates/header.phtml index 01b86ceb413af76ebd874f20de19afa3c7e766cd..d053923c32a1e76f910989acd23ba20d63ff2262 100644 --- a/themes/fid_bbi/templates/header.phtml +++ b/themes/fid_bbi/templates/header.phtml @@ -5,7 +5,8 @@ // NOTE: These strings are hardcoded because they mirror the logo, // which is language-independent ?> - <?php if ($this->templateName === 'home'): ?> + <?php $isHome = $this->templateDir === 'search' && $this->templateName === 'home'; ?> + <?php if ($isHome): ?> <h1> <a class="header_logo" href="<?=$this->url('home')?>"> <?=$this->icon('../images/fid-bbi-logo', '')?> @@ -29,7 +30,7 @@ <div class="box -header"> <div id="search" class="search"> - <?php if ($this->templateName === 'home'): ?> + <?php if ($isHome): ?> <?=$this->layout()->searchbox?> <div class="search_links"> diff --git a/themes/fid_bbi/templates/layout/layout.phtml b/themes/fid_bbi/templates/layout/layout.phtml index 0a21b508a4eb29989b9f0758444e14945df53970..5717ae04a19a80ae3ce43f49fd76cfc47670de7b 100644 --- a/themes/fid_bbi/templates/layout/layout.phtml +++ b/themes/fid_bbi/templates/layout/layout.phtml @@ -2,8 +2,19 @@ <?php // NOTE: There must not be anything above html-head.phtml, not even comments or whitespace ?> <!-- fid_bbi: layout - layout --> -<body class="layout <?=$this->templateName === 'home' ? '-home' : '-default'?>"> - <?php $this->layout()->searchbox = $this->render('search/searchbox.phtml'); ?> +<?php $isHome = $this->templateDir === 'search' && $this->templateName === 'home'; ?> +<body class="layout <?=$isHome ? '-home' : '-default'?>"> + <?php + // Set up the search box -- there are three possible cases: + // 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 (!isset($this->layout()->searchbox)) { + $this->layout()->searchbox = $this->render('search/searchbox.phtml'); + } + ?> <?php // Add landmark role to avoid 'all content must be inside landmarks error', CK ?> <div role="navigation" aria-label="Skip_navigation_links"> @@ -19,7 +30,11 @@ <?php // NOTE: `role="main` is obsolete, but several scripts stop working when it is removed ?> <main class="main" role="main"> - <div class="main_wrap"> + <?php + // NOTE: Class `container` is required by JS, otherwise nothing happens + // when "Save" is clicked in the modal while creating a new list. + ?> + <div class="main_wrap container"> <?=$this->layout()->content?> </div> </main> diff --git a/themes/fid_bbi/templates/myresearch/bulk-action-buttons.phtml b/themes/fid_bbi/templates/myresearch/bulk-action-buttons.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9291f29affc42dbc105bffddf65ea59b964a98c3 --- /dev/null +++ b/themes/fid_bbi/templates/myresearch/bulk-action-buttons.phtml @@ -0,0 +1,69 @@ +<!-- fid_bbi: myresearch - bulk-action-buttons --> +<?php +/** + * This is mostly a copy of themes/bootstrap3/templates/myresearch/bulk-action-buttons.phtml + * FID BBI specific changes: + * - change HTML structure and classes on some elements + * + * @author Tobias Schäfer <ts@aspectis.net> + */ +?> + +<?php if (isset($locations)): ?> + <input type="hidden" name="listID" value="<?=$this->escapeHtmlAttr($locations->id)?>"> + <input type="hidden" name="listName" value="<?=$this->escapeHtmlAttr($locations->title)?>"> +<?php endif; ?> + +<div class="results_bulk-actions"> + <div class="results_bulk-selection"> + <input type="checkbox" name="selectAll" class="checkbox-select-all" id="myresearchCheckAll"> + <label for="myresearchCheckAll"> + <?=$this->translate('select_page')?> | <?=$this->translate('with_selected')?>: + </label> + </div> + <div class="results_bulk-buttons"> + <?php if ($this->cart()->isActive()): ?> + <button class="button -icon -small" id="<?=$this->idPrefix?>updateCart" type="submit" name="add"> + <?=$this->icon('small/pin')?> + <?=$this->translate('Add to Book Bag')?> + </button> + <?php endif; ?> + + <button class="button -icon -small" type="submit" name="email" title="<?=$this->translate('email_selected')?>"> + <?=$this->icon('small/mail')?> + <?=$this->translate('Email')?> + </button> + + <?php $user = $this->auth()->isLoggedIn(); ?> + <?php if ((null !== $this->list && $this->list->editAllowed($user)) || null === $this->list && $user): ?> + <button + class="button -icon -small" + id="<?=$this->idPrefix?>delete_list_items_<?=$this->list !== null ? $this->escapeHtmlAttr($this->list->id) : ''?>" + type="submit" name="delete" + title="<?=$this->translate('delete_selected')?>" + > + <?=$this->icon('small/trash')?> + <?=$this->translate('Delete')?> + </button> + <?php endif; ?> + + <?php $exportOptions = $this->export()->getActiveFormats('bulk'); if (count($exportOptions) > 0): ?> + <button class="button -icon -small" type="submit" name="export" title="<?=$this->translate('export_selected')?>"> + <?=$this->icon('small/download')?> + <?=$this->translate('Export')?> + </button> + <?php endif; ?> + + <button + class="button -icon -small" + type="submit" + name="print" + title="<?=$this->translate('print_selected')?>" + data-lightbox-ignore + > + <?=$this->icon('small/printer')?> + <?=$this->translate('Print')?> + </button> + </div> +</div> +<!-- fid_bbi: myresearch - bulk-action-buttons - END --> diff --git a/themes/fid_bbi/templates/myresearch/edit.phtml b/themes/fid_bbi/templates/myresearch/edit.phtml index 08ab430b12c4721db97aa0f827d7722f7e7bc7e3..a9d77b5f869833ee4e1251ddf00eb382e7e0b041 100644 --- a/themes/fid_bbi/templates/myresearch/edit.phtml +++ b/themes/fid_bbi/templates/myresearch/edit.phtml @@ -3,79 +3,96 @@ /** * This is mostly a copy of themes/bootstrap3/templates/myresearch/edit.phtml * FID BBI specific changes: - * * move List Name down to correspond - * to list selection drop down (#17356) - * * add descriptive text above input field + * - move List Name down to correspond to list selection drop down (#17356) + * - add descriptive text above input field + * - make heading <h1> + * - change HTML to conform to other BBI forms + * - add missing label + * - use translate instead of transEsc for save strings * * @author Dorian Merz <merz@ub.uni-leipzig.de> + * @author Tobias Schäfer <ts@aspectis.net> */ ?> -<?php - // Set up page title: - $this->headTitle($this->translate('Edit') . ' : ' . $this->driver->getBreadcrumb()); +<?php $this->headTitle($this->translate('Edit') . ' ' . $this->driver->getBreadcrumb()); ?> - // Set up breadcrumbs: - $this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Edit') . '</li>'; -?> -<div class="record"> - <h2><?=$this->escapeHtml($this->driver->getBreadcrumb())?></h2> +<h1><?=$this->escapeHtml($this->driver->getBreadcrumb())?></h1> - <form class="form-list-edit" method="post" name="editForm"> - <?php if (empty($this->savedData)): ?> - <p class="alert alert-info"> +<form class="form-list-edit" method="post" name="editForm"> +<?php if (empty($this->savedData)): ?> + <div class="alert -info"> + <?=$this->icon('small/info')?> + <p> <?php if (isset($listFilter)): ?> - <?=$this->transEsc('The record you selected is not part of the selected list.') ?> + <?=$this->translate('The record you selected is not part of the selected list.')?> <?php else: ?> - <?=$this->transEsc('The record you selected is not part of any of your lists.') ?> + <?=$this->translate('The record you selected is not part of any of your lists.')?> <?php endif; ?> </p> - <?php else: ?> - <div class="list-edit-container"> - <?php foreach ($this->savedData as $i => $current): ?> - <fieldset class="list-edit-group"> - <h3><?=$this->translate('currently_on_list',['%%list_name%%' => $this->escapeHtml($current['listTitle'])]) ?></h3> - <input type="hidden" name="lists[]" value="<?=$current['listId'] ?>"/> - <?php if ($this->usertags()->getMode() !== 'disabled'): ?> - <hr/> - <h3><?=$this->transEsc('Add Tags') ?></h3> - <div class="form-group"> - <?php /* fid_bbi: add descriptive text aove input field, cf. #17356, DM */?> - <p class="help-block"><?=$this->transEsc("add_tag_description")?></p> - <label class="control-label" for="edit_tags<?=$current['listId'] ?>"><?=$this->transEsc('Tags') ?>:</label> - <input type="text" name="tags<?=$current['listId'] ?>" id="edit_tags<?=$current['listId'] ?>" class="form-control" value="<?=$this->escapeHtmlAttr($current['tags'])?>"/> - <span class="help-block"><?=$this->transEsc("add_tag_note") ?></span> - </div> - <?php endif; ?> - <hr/> + </div> +<?php else: ?> + <div class="list-edit-container"> + <?php foreach ($this->savedData as $i => $current): ?> + <p> + <b><?=$this->translate('currently_on_list',['%%list_name%%' => $this->escapeHtml($current['listTitle'])])?></b> + </p> + + <fieldset class="list-edit-group -limit-width"> + <?php if ($this->usertags()->getMode() !== 'disabled'): ?> + <h2><?=$this->translate('Add Tags')?></h2> <div class="form-group"> - <label class="control-label" for="edit_notes<?=$current['listId'] ?>"><?=$this->transEsc('Notes') ?>:</label> - <textarea class="form-control" id="edit_notes<?=$current['listId'] ?>" name="notes<?=$current['listId'] ?>" rows="3"><?=$this->escapeHtml($current['notes'])?></textarea> + <?php // fid_bbi: add descriptive text aove input field, cf. #17356, DM ?> + <p class="help-block"><?=$this->translate('add_tag_description')?></p> + <label class="control-label" for="edit_tags<?=$current['listId']?>"> + <?=$this->translate('Tags')?> + </label> + <input type="text" name="tags<?=$current['listId'] ?>" id="edit_tags<?=$current['listId']?>" class="form-control" value="<?=$this->escapeHtmlAttr($current['tags'])?>"/> + <span class="help-block"><?=$this->translate('add_tag_note')?></span> </div> - <hr/> - <a href="<?=$this->url('userList', ['id' => $current['listId']]) ?>?delete=<?=urlencode($this->driver->getUniqueId())?>&source=<?=urlencode($this->driver->getSourceIdentifier())?>" id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>delete<?=$current['listId'] ?>" data-lightbox> - <i class="fa fa-trash"></i> <?=$this->transEsc('delete_from_list',['%%list_name%%' => $this->escapeHtml($current['listTitle'])]) ?> - </a> - </fieldset> + <?php endif; ?> + + <div class="form-group"> + <label class="control-label" for="edit_notes<?=$current['listId'] ?>"> + <?=$this->translate('Notes') ?> + </label> + <textarea + class="form-control" + id="edit_notes<?=$current['listId'] ?>" + name="notes<?=$current['listId'] ?>" + rows="3" + ><?=$this->escapeHtml($current['notes'])?></textarea> + </div> + <a + href="<?=$this->url('userList', ['id' => $current['listId']]) ?>?delete=<?=urlencode($this->driver->getUniqueId())?>&source=<?=urlencode($this->driver->getSourceIdentifier())?>" + id="<?=$this->escapeHtmlAttr($this->driver->getUniqueId())?>delete<?=$current['listId']?>" + data-lightbox + > + <?=$this->transEsc('delete_from_list', ['%%list_name%%' => $this->escapeHtml($current['listTitle'])])?> + </a> + <input type="hidden" name="lists[]" value="<?=$current['listId']?>"> + </fieldset> + <?php endforeach; ?> + </div> +<?php endif; ?> + +<?php if (count($this->lists) > 0): ?> + <p style="margin-bottom: 0"> + <label for="add-to-list"><?=$this->translate('Add to another list')?></label> + </p> + <p> + <select id="add-to-list" name="addToList" class="form-control"> + <option value="-1"> </option> + <?php foreach ($this->lists as $listID => $listTitle): ?> + <option value="<?=$listID ?>"><?=$this->escapeHtml($listTitle)?></option> <?php endforeach; ?> - </div> - <?php endif; ?> - <?php if (count($this->lists) > 0): ?> - <hr/> - <div class="form-group"> - <select name="addToList" class="form-control"> - <?php /* Fixme: this seems to need a label for accessibility - CK */ ?> - <option value="-1">- <?=$this->transEsc('Add to another list')?> -</option> - <?php foreach ($this->lists as $listID => $listTitle): ?> - <option value="<?=$listID ?>"><?=$this->escapeHtml($listTitle) ?></option> - <?php endforeach; ?> - </select> - </div> - <?php endif; ?> - <?php if (!empty($this->savedData) || count($this->lists) > 0): ?> - <div class="form-group"> - <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->transEsc('Save') ?>"/> - </div> - <?php endif; ?> - </form> -</div> + </select> + </p> +<?php endif; ?> + +<?php if (!empty($this->savedData) || count($this->lists) > 0): ?> + <div class="form-group"> + <input class="btn btn-primary" type="submit" name="submit" value="<?=$this->translate('Save') ?>"> + </div> +<?php endif; ?> +</form> <!-- fid_bbi: myresearch - edit - END --> diff --git a/themes/fid_bbi/templates/myresearch/editlist.phtml b/themes/fid_bbi/templates/myresearch/editlist.phtml new file mode 100644 index 0000000000000000000000000000000000000000..b6f379700c8a91940655d903fa663bbdcc6d416b --- /dev/null +++ b/themes/fid_bbi/templates/myresearch/editlist.phtml @@ -0,0 +1,95 @@ +<!-- fid_bbi: myresearch - editlist --> +<?php +/** + * Copied from themes/bootstrap3/templates/myresearch/editlist.phtml + * FID BBI specific changes: + * - unwrap and append label to radio inputs for CSS-only styling + * - add ARIA label to the radio input group + * - remove obsolete breadcrumbs + * - use h1 instead of h2 + * - add template start/end comments + * - clean up code + * + * @author Tobias Schäfer <ts@aspectis.net> + */ + +$pageTitle = empty($this->list->id) ? 'Create a List' : 'edit_list'; +$this->headTitle($this->translate($pageTitle)); +?> + +<?=$this->flashmessages()?> + +<h1><?=$this->translate($pageTitle)?></h1> + +<form class="form-edit-list" method="post" name="<?=empty($this->list->id) ? 'newList' : 'editListForm'?>"> + <input type="hidden" name="id" value="<?=empty($this->list->id) ? 'NEW' : $this->list->id ?>"> + + <div class="form-group"> + <label class="control-label" for="list_title"> + <?=$this->translate('List')?> + </label> + <input + id="list_title" + class="form-control" + type="text" + name="title" + value="<?=isset($this->list['title']) ? $this->escapeHtml($this->list['title']) : ''?>" + > + </div> + + <div class="form-group"> + <label class="control-label" for="list_desc"> + <?=$this->translate('Description')?> + </label> + <textarea + id="list_desc" + class="form-control" + name="desc" + rows="3" + ><?=isset($this->list['description']) ? $this->escapeHtml($this->list['description']) : ''?></textarea> + </div> + + <?php if ($this->userlist()->getMode() === 'public_only'): ?> + <input type="hidden" name="public" value="1"> + <?php elseif ($this->userlist()->getMode() === 'private_only'): ?> + <input type="hidden" name="public" value="0"> + <?php else: ?> + <div class="form_row"> + <div class="form_label" id="access-label"> + <?=$this->translate('Access')?> + </div> + <div class="form_control" aria-labelledby="access-label"> + <p> + <input + id="list_public_1" + type="radio" + name="public" + value="1" + <?=$this->list->isPublic() ? 'checked' : ''?> + > + <label for="list_public_1"> + <?=$this->translate('Public')?> + </label> + </p> + <p> + <input + id="list_public_0" + type="radio" + name="public" + value="0" + <?=!$this->list->isPublic() ? 'checked' : ''?> + > + <label for="list_public_0"> + <?=$this->translate('Private')?> + </label> + </p> + </div> + </div> + <?php endif; ?> + + <div class="form-group"> + <?php // NOTE: Replacing this with a <button> breaks save functionality ?> + <input type="submit" name="submit" value="<?=$this->translate('Save') ?>"> + </div> +</form> +<!-- fid_bbi: myresearch - editlist - END --> diff --git a/themes/fid_bbi/templates/myresearch/menu.phtml b/themes/fid_bbi/templates/myresearch/menu.phtml index 016abdce16c3b8936f845c44248fec586aa1bb68..0c0b767ed76385744a1973818430475b0c475183 100644 --- a/themes/fid_bbi/templates/myresearch/menu.phtml +++ b/themes/fid_bbi/templates/myresearch/menu.phtml @@ -1,110 +1,132 @@ -<?php -/** -* copied from /fid/templates/myresearch/menu.phtml -* which is -* copied from /bootstrap3/templates/myresearch/menu.phtml -* changed to include user tags menu entry -* -* @author Dorian Merz <merz@ub.uni-leipzig.de> -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License -* @link https://vufind.org Main Page -*/ -?> -<!-- fid_bbi: myresearch - menu.phtml --> -<?php - $user = $this->auth()->isLoggedIn(); -?> -<?php /* Offcanvas closing button missing in BS3! CK*/ ?> -<button class="close-offcanvas btn btn-link" data-toggle="offcanvas"><?=$this->transEsc('navigate_back') ?></button> - +<!-- fid_bbi: myresearch - menu --> +<?php $user = $this->auth()->isLoggedIn(); ?> <?php if (!empty($user)): ?> - <h4><?=$this->transEsc('Your Account')?></h4> - <div class="myresearch-menu account-menu"> - <?php if ('ils-none' !== $this->ils()->getOfflineMode()): ?> - <a href="<?=$this->url('myresearch-profile')?>"<?=$this->active == 'profile' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-user" aria-hidden="true"></i> - <?=$this->transEsc('Profile')?> - </a> + <div class="sidebar -profile" id="profile-menu"> + <div class="sidebar_header"> + <h2><?=$this->translate('Profile Menu')?></h2> + <button + class="-icon-only -small" + type="button" + aria-controls="profile-menu" + > + <?=$this->icon('small/x')?> + <span class="sr-only"><?=$this->translate('Close')?></span> + </button> + </div> - <?php /* refs #15480 add password change to fid profile */ ?> - <a href="<?=$this->url('fid/user/reset-password')?>" data-lightbox> - <span class="no-padding"> - <i class="fa fa-fw fa-lock" aria-hidden="true"></i> - </span> - <?=$this->transEsc('Change Password')?> - </a> + <div class="sidebar_inner"> + <h3><?=$this->translate('Your Account')?></h3> + <ul class="unstyled-list"> + <?php if ('ils-none' !== $this->ils()->getOfflineMode()): ?> + <li> + <a + href="<?=$this->url('myresearch-profile')?>" + <?=$this->active === 'profile' ? 'class="active"' : ''?> + > + <?=$this->translate('Profile')?> + </a> + </li> - <a href="<?=$this->url('fid/user/change-username')?>" data-lightbox> - <span class="no-padding"> - <i class="fa fa-fw fa-envelope" aria-hidden="true"></i> - </span> - <?=$this->transEsc('fid::username_change_link')?> - </a> + <?php // refs #15480 add password change to fid profile ?> + <li> + <a href="<?=$this->url('fid/user/reset-password')?>" data-lightbox> + <?=$this->translate('Change Password')?> + </a> + </li> - <span class="logout-button"> - <a href="<?=$this->url('myresearch-logout')?>"> - <span class="no-padding"> - <span class="no-padding"> - <i class="fa fa-fw fa-sign-out" aria-hidden="true"></i> - </span> - <?=$this->transEsc("Logout")?> - </a> - </span> + <li> + <a href="<?=$this->url('fid/user/change-username')?>" data-lightbox> + <?=$this->translate('fid::username_change_link')?> + </a> + </li> - <?php if ($user->libraryCardsEnabled()): ?> - <a href="<?=$this->url('librarycards-home')?>"<?=$this->active == 'librarycards' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->transEsc('Library Cards')?> - </a> - <?php endif; ?> - <?php endif; ?> - </div> + <li> + <a href="<?=$this->url('myresearch-logout')?>"> + <?=$this->translate("Logout")?> + </a> + </li> - <?php if ('enabled' === $this->usertags()->getMode()): ?> - <br/> - <h4><?=$this->translate('Your Tags')?></h4> - <div class="myresearch-menu"> - <a href="<?=$this->url('myresearch-usertags')?>"<?=$this->active == 'tags' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-tags" aria-hidden="true"></i> - <?=$this->translate('show_usertags')?> + <?php if ($user->libraryCardsEnabled()): ?> + <li> + <a + href="<?=$this->url('librarycards-home')?>" + <?=$this->active === 'librarycards' ? 'class="active"' : ''?>> + <i class="fa fa-fw fa-barcode" aria-hidden="true"></i> <?=$this->translate('Library Cards')?> + </a> + </li> + <?php endif; ?> + <?php endif; ?> + </ul> + + <?php if ($this->userlist()->getMode() !== 'disabled'): ?> + <h3><?=$this->translate('Your Lists')?></h3> + <ul class="unstyled-list"> + <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> + <li> + <a + href="<?=$this->url('search-history')?>?require_login" + <?=$this->active === 'history' ? ' class="active"' : ''?> + > + <?=$this->translate('history_saved_searches')?> + </a> + </li> + <?php endif; ?> + + <li> + <a + href="<?=$this->url('myresearch-favorites')?>" + <?=$this->active === 'favorites' ? 'class="active"' : ''?> + > + <?=$this->translate('Your Favorites')?> + </a> + </li> + + <?php foreach ($user->getLists() as $list): ?> + <li> + <a + href="<?=$this->url('userList', ['id' => $list['id']])?>" + <?=$this->active === 'list' . $list['id'] ? 'class="active"' : ''?> + > + <?=$this->escapeHtml($list['title'])?> + (<?=$list->cnt?>) + </a> + </li> + <?php endforeach; ?> + + <li> + <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"> + <?=$this->translate('Create a List') ?> </a> - </div> - <?php endif; ?> + </li> + </ul> - <?php if ($this->userlist()->getMode() !== 'disabled'): ?> - <br /> - <h4><?=$this->transEsc('Your Lists')?></h4> + <?=$this->context($this)->renderInContext('myresearch/menu-additional-entries.phtml', array())?> + <?php endif ?> - <div class="myresearch-menu"> - <?php if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?> - <a href="<?=$this->url('search-history')?>?require_login"<?=$this->active == 'history' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-search" aria-hidden="true"></i> <?=$this->transEsc('history_saved_searches')?> - </a> + <?php if ($this->usertags()->getMode() === 'enabled'): ?> + <h3><?=$this->translate('Your Tags')?></h3> + <p> + <a + href="<?=$this->url('myresearch-usertags')?>" + <?=$this->active === 'tags' ? 'class="active"' : ''?> + > + <?=$this->translate('show_usertags')?> + </a> + </p> + <?php endif; ?> + + <?php if ($this->permission()->allowDisplay('fid.ReadList')): ?> + <h3><?=$this->translate('fid::admin_section')?></h3> + <ul class="unstyled-list"> + <li> + <a href="<?=$this->url('fid/admin/list')?>"><?=$this->translate('fid::permission_read_user_list')?></a> + </li> + <li> + <a href="<?=$this->url('admin/tags', ['action' => 'List'])?>"><?=$this->translate('Tag Management')?></a> + </li> + </ul> <?php endif; ?> - <a href="<?=$this->url('myresearch-favorites')?>"<?=$this->active == 'favorites' ? ' class="active"' : ''?>> - <i class="fa fa-fw fa-star" aria-hidden="true"></i> <?=$this->transEsc('Your Favorites')?> - </a> - <?php $lists = $user->getLists() ?> - <?php foreach ($lists as $list): ?> - <a href="<?=$this->url('userList', ['id' => $list['id']])?>"<?=$this->active == 'list' . $list['id'] ? ' class="active"' : ''?>> - <?=$this->escapeHtml($list['title'])?> - <span class="badge"><?=$list->cnt ?></span> - </a> - <?php endforeach; ?> - <a href="<?=$this->url('editList', ['id' => 'NEW'])?>"> - <i class="fa fa-fw fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Create a List') ?> - </a> - <?=$this->context($this)->renderInContext('myresearch/menu-additional-entries.phtml', array())?> </div> - <?php endif ?> - <?php if ($this->permission()->allowDisplay('fid.ReadList')): ?> - <br/> - <h4><?=$this->transEsc('fid::admin_section')?></h4> - <div class="myresearch-menu"> - <a href="<?=$this->url('fid/admin/list')?>"><?=$this->transEsc('fid::permission_read_user_list')?></a> - </div> - <div class="myresearch-menu"> - <a href="<?=$this->url('admin/tags', ['action' => 'List'])?>"><?=$this->transEsc('Tag Management')?></a> </div> - <?php endif; ?> <?php endif; ?> -<!-- fid_bbi: myresearch - menu.phtml END --> \ No newline at end of file +<!-- fid_bbi: myresearch - menu - END --> diff --git a/themes/fid_bbi/templates/myresearch/mylist.phtml b/themes/fid_bbi/templates/myresearch/mylist.phtml new file mode 100644 index 0000000000000000000000000000000000000000..0211d51f666f617b3479a1b84d4b59e48920f09d --- /dev/null +++ b/themes/fid_bbi/templates/myresearch/mylist.phtml @@ -0,0 +1,128 @@ +<!-- fid_bbi: myresearch - mylist --> +<?php +/** + * This is mostly a copy of themes/finc/templates/myresearch/mylist.phtml + * FID BBI specific changes: + * - remove <ul> wrapper element from list items + * + * @author Tobias Schäfer <ts@aspectis.net> + */ +?> +<?php +// Grab list object from search results (if applicable) +$list = $this->results->getListObject(); + +// Set up page title: +$this->headTitle(isset($list) ? $list->title : $this->translate('Favorites')); + +// Load Javascript dependencies into header +$this->headScript()->appendFile('check_item_statuses.js'); + +// Load Javascript only if list view parameter is NOT full +if ($this->params->getOptions()->getListViewOption() != 'full') { + $this->headScript()->appendFile('record.js'); + $this->headScript()->appendFile('embedded_record.js'); +} + +$recordTotal = $this->results->getResultTotal(); + +// Convenience variable +$account = $this->auth()->getManager(); +$user = $this->auth()->isLoggedIn(); +?> + +<h1><?=$list ? $this->escapeHtml($list->title) : $this->transEsc('Your Favorites')?></h1> + +<?=$this->flashmessages()?> + +<div class="results"> + <button class="results_sidebar-toggle" type="button" aria-controls="profile-menu"> + <?=$this->icon('small/person')?> + <span><?=$this->transEsc('Profile Menu')?></span> + </button> + + <div class="results_list -wide"> + <nav class="results_header -wide"> + <?php if ($recordTotal > 0): ?> + <div class="results_count"> + <?=$this->translate('%%count%% results', ['%%count%%' => $this->localizedNumber($recordTotal)])?> + </div> + <?php endif; ?> + + <?php if (isset($list)): ?> + <?php if ($list->editAllowed($account->isLoggedIn())): ?> + <div class="results_list-actions"> + <div> + <a href="<?=$this->url('editList', ['id' => $list->id])?>"> + <?=$this->transEsc('edit_list')?> + </a> + </div> + <div> + <a + class="dropdown-toggle" + data-toggle="dropdown" + href="<?=$this->url('myresearch-deletelist')?>?listID=<?=urlencode($list->id)?>" + > + <?=$this->transEsc('delete_list')?> + </a> + <ul class="dropdown-menu"> + <li> + <a href="<?=$this->url('myresearch-deletelist')?>?listID=<?=urlencode($list->id)?>&confirm=1"> + <?=$this->transEsc('confirm_dialog_yes')?> + </a> + </li> + <li> + <a href="#"> + <?=$this->transEsc('confirm_dialog_no')?> + </a> + </li> + </ul> + </div> + </div> + <?php endif; ?> + <?php endif; ?> + <?php if ($recordTotal > 0): ?> + <?=$this->render('search/controls/limit.phtml')?> + <?=$this->render('search/controls/sort.phtml')?> + <?php endif; ?> + </nav> + + <?php if ($list && !empty($list->description)): ?> + <p class="results_list-description"><?=$this->escapeHtml($list->description)?></p> + <?php endif; ?> + + <?php if ($recordTotal > 0): ?> + <form + class="form-inline" + method="post" + name="bulkActionForm" + action="<?=$this->url('cart-myresearchbulk')?>" + data-lightbox + data-lightbox-onsubmit="bulkFormHandler" + > + <?=$this->context($this)->renderInContext('myresearch/bulk-action-buttons.phtml', ['idPrefix' => '', 'list' => $list ?? null, 'account' => $this->account])?> + + <?php foreach ($this->results->getResults() as $i => $current): ?> + <?=$this->record($current)->getListEntry($list, $user)?> + <?php endforeach; ?> + </form> + + <?=$this->paginationControl($this->results->getPaginator(), 'Sliding', 'search/pagination.phtml', ['results' => $this->results])?> + <?php else: ?> + <div class="alert -info"> + <?=$this->icon('small/info')?> + <p><?=$this->transEsc('You do not have any saved resources')?></p> + </div> + <?php endif; ?> + </div> + + <?php if ($user): ?> + <?=$this->context($this)->renderInContext('myresearch/menu.phtml', ['active' => isset($list) ? 'list' . $list['id'] : 'favorites'])?> + <?php endif; ?> +</div> + +<?php +// TODO: Would be nice to move the bulk actions into a sidebar, but they need to +// be wrapped inside the same form as the item list +?> +<!-- fid_bbi: myresearch - mylist - END --> diff --git a/themes/fid_bbi/templates/myresearch/profile.phtml b/themes/fid_bbi/templates/myresearch/profile.phtml index a9598b4dd8858e36b4213209c7c05e7df3cae309..a7865f8427cb2fe582a7217b2572598052e7cbde 100644 --- a/themes/fid_bbi/templates/myresearch/profile.phtml +++ b/themes/fid_bbi/templates/myresearch/profile.phtml @@ -1,64 +1,62 @@ <!-- fid_bbi: myresearch - profile --> <?php -// Set up page title: $this->headTitle($this->translate('My Profile')); -// Set up breadcrumbs: -$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>'; - -// Template for use by the renderArray helper: -$arrTemplate = '<tr><th>%%LABEL%%:</th><td> %%VALUE%%</td></tr>'; - $profile = $this->profile; if (is_array($profile)) { $groups = $this->UserGroups($profile['user']->getPermissions()); $profile['group'] = $groups->granted(); $profile['job_title'] = $this->translate('fid::job_title_' . $profile['user']->getJobTitle()); - $profile['salutation'] = !empty($profile['user']->getSalutation()) ? - $this->translate('fid::label_salutation_' . $profile['user']->getSalutation()) : ''; - $profile['academic_title'] = !empty($profile['user']->getAcademicTitle()) ? - $profile['user']->getAcademicTitle() : ''; - $profile['home_library'] = !empty($profile['user']->getHomeLibrary()) ? - $profile['libs'][$profile['user']->getHomeLibrary()]->getLabel() : ''; - $profile['college'] = !empty($profile['user']->getCollege()) ? - $profile['user']->getCollege() : ''; + $profile['salutation'] = !empty($profile['user']->getSalutation()) + ? $this->translate('fid::label_salutation_' . $profile['user']->getSalutation()) + : ''; + $profile['academic_title'] = !empty($profile['user']->getAcademicTitle()) + ? $profile['user']->getAcademicTitle() + : ''; + $profile['home_library'] = !empty($profile['user']->getHomeLibrary()) + ? $profile['libs'][$profile['user']->getHomeLibrary()]->getLabel() + : ''; + $profile['college'] = !empty($profile['user']->getCollege()) + ? $profile['user']->getCollege() + : ''; } ?> -<div class="<?=$this->layoutClass('mainbody')?>"> - <?php /* finc V5: adds offcanvas-toggler missing in VF5, compare with finc/fid themes during update - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?> - <h2><?=$this->transEsc('Your Profile')?></h2> - <?=$this->flashmessages();?> - <?php if (is_array($this->profile)): ?> - <div class="table-responsive"><table class="table table-striped"> - <?=$this->renderArray( - $arrTemplate, - $profile, - array_merge( - [ - $this->transEsc('fid::label_username') => 'email' - ], +<h1><?=$this->translate('My Profile')?></h1> + +<?=$this->flashmessages();?> + +<div class="results"> + <button class="results_sidebar-toggle" type="button" aria-controls="profile-menu"> + <?=$this->icon('small/person')?> + <span><?=$this->transEsc('Profile Menu')?></span> + </button> + + <div class="results_list"> + <?php if (is_array($this->profile)): ?> + <dl> + <?=$this->renderArray( + '<dt>%%LABEL%%</dt><dd>%%VALUE%%</dd>', + $profile, + array_merge( + [ $this->transEsc('fid::label_username') => 'email' ], $profile['academic_title'] ? [$this->transEsc('fid::label_home_library') => 'home_library'] : [], $profile['academic_title'] ? [$this->transEsc('fid::label_academic_title') => 'academic_title'] : [], $profile['salutation'] ? [$this->transEsc('fid::label_salutation') => 'salutation'] : [], $profile['firstname'] ? [$this->transEsc('fid::label_firstname') => 'firstname'] : [], $profile['lastname'] ? [$this->transEsc('fid::label_lastname') => 'lastname'] : [], $profile['college'] ? [$this->transEsc('fid::label_college') => 'college'] : [], - [ - $this->transEsc('fid::label_job_title') => 'job_title' - ], + [ $this->transEsc('fid::label_job_title') => 'job_title' ], $profile['address1'] ?? '' ? [$this->transEsc('Address') => 'address1'] : [] - ) - )?> - </table></div> - <a href="<?=$this->url('fid/user/update')?>" class="btn btn-primary"><?=$this->transEsc('fid::Edit Account')?></a> - <?php elseif ('ils-none' !== $this->ils()->getOfflineMode() && $this->patronLoginView && !empty($this->patronLoginView->getTemplate())): ?> - <?=$this->partial($this->patronLoginView);?> - <?php endif; ?> -</div> + ) + )?> + </dl> + <?php $patronTemplateSet = $this->patronLoginView && !empty($this->patronLoginView->getTemplate()); ?> + <?php elseif ($this->ils()->getOfflineMode() !== 'ils-none' && $patronTemplateSet): ?> + <?=$this->partial($this->patronLoginView);?> + <?php endif; ?> + </div> -<div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'profile'])?> + <?=$this->context($this)->renderInContext('myresearch/menu.phtml', ['active' => 'profile'])?> </div> <!-- fid_bbi: myresearch - profile - END --> diff --git a/themes/fid_bbi/templates/myresearch/usertags.phtml b/themes/fid_bbi/templates/myresearch/usertags.phtml index 5b9c6b3c23d1e471a1ba51c5f5650ba0517dbebd..df5090a986f0e5120276b839663aff855bef12b3 100644 --- a/themes/fid_bbi/templates/myresearch/usertags.phtml +++ b/themes/fid_bbi/templates/myresearch/usertags.phtml @@ -1,50 +1,57 @@ <!-- fid_bbi: myresearch - usertags --> -<?php -// Set up page title: -$this->headTitle($this->translate('Your Tags')); +<?php $this->headTitle($this->translate('Your Tags')); ?> -// Set up breadcrumbs: -$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>'; -?> -<div class="<?=$this->layoutClass('mainbody')?>"> - <?php /* finc V5: adds offcanvas-toggler missing in VF5, compare with finc/fid themes during update - CK */ ?> - <?=$this->render('RecordDriver/DefaultRecord/offcanvas-toggler-myresearch'); ?> -<h2><?=$this->translate('Your Tags')?></h2> +<h1><?=$this->translate('Your Tags')?></h1> + +<div class="results"> + <button class="results_sidebar-toggle" type="button" aria-controls="profile-menu"> + <?=$this->icon('small/person')?> + <span><?=$this->transEsc('Profile Menu')?></span> + </button> + + <div class="results_list"> <?php if (!empty($tags)): ?> - <table class="tags table-responsive"> - <tr> - <th><?=$this->translate('Tag')?></th> - <th>#<span class="hidden-xs"> <?=$this->translate('tags_record_count')?></span></th> - <th><?=$this->translate('tags_records_on_lists')?></th> - </tr> - <?php foreach ($tags as $tag): ?> + <table class="tags table-responsive"> <tr> - <td><a href="<?=$this->url('tag-home',[],['query' => ['lookfor' => $tag->tag]])?>"> - <?=$tag->tag?> - </a></td> - <td><?=$tag->cnt ?></td> - <td> - <?php $onLists = explode(',',$tag->lists ?? ''); - sort($onLists); - if (!empty($onLists)):?> - <? foreach ($onLists as $id): ?> - <?php if ($list = $lists[$id] ?? null): ?> - <span><a href="<?=$this->url('userList',['id'=>$list['id']])?>"><?=$list['title']?></a></span> - <?php endif; ?> - <?php endforeach; ?> - <?php endif; ?> - </td> + <th><?=$this->translate('Tag')?></th> + <th>#<span class="hidden-xs"> <?=$this->translate('tags_record_count')?></span></th> + <th><?=$this->translate('tags_records_on_lists')?></th> </tr> - <?php endforeach; ?> - </table> + <?php foreach ($tags as $tag): ?> + <tr> + <td> + <a href="<?=$this->url('tag-home',[],['query' => ['lookfor' => $tag->tag]])?>"> + <?=$tag->tag?> + </a> + </td> + <td><?=$tag->cnt?></td> + <td> + <?php + $onLists = explode(',', $tag->lists ?? ''); + sort($onLists); + ?> + <?php if (!empty($onLists)): ?> + <? foreach ($onLists as $id): ?> + <?php if ($list = $lists[$id] ?? null): ?> + <span> + <a href="<?=$this->url('userList', ['id'=>$list['id']])?>"> + <?=$list['title']?> + </a> + </span> + <?php endif; ?> + <?php endforeach; ?> + <?php endif; ?> + </td> + </tr> + <?php endforeach; ?> + </table> <?php endif; ?> - <br/> - <div class="tag-browse-button"> - <a href="<?=$this->url('browse-tag')?>"><?=$this->translate('tags_browse')?></a> - </div> -</div> -<div class="<?=$this->layoutClass('sidebar')?>"> - <?=$this->context($this)->renderInContext("myresearch/menu.phtml", ['active' => 'tags'])?> + <p class="tag-browse-button"> + <a href="<?=$this->url('browse-tag')?>"><?=$this->translate('tags_browse')?></a> + </p> + </div> + + <?=$this->context($this)->renderInContext('myresearch/menu.phtml', ['active' => 'tags'])?> </div> -<!-- fid_bbi: myresearch - usertags - END --> \ No newline at end of file +<!-- fid_bbi: myresearch - usertags - END --> diff --git a/themes/fid_bbi/templates/record/checkbox.phtml b/themes/fid_bbi/templates/record/checkbox.phtml new file mode 100644 index 0000000000000000000000000000000000000000..f320511608a51297efb8e84599c107fd95779058 --- /dev/null +++ b/themes/fid_bbi/templates/record/checkbox.phtml @@ -0,0 +1,37 @@ +<!-- fid_bbi: record - checkbox --> +<?php +/** + * Copied from themes/finc/templates/record/checkbox.phtml + * FID BBI specific changes: + * - Put label behind checkbox instead of wrapping the checkbox inside the label + * so the checkbox can be styled without applying JavaScript + * + * @author Tobias Schäfer <ts@aspectis.net> + */ +?> + +<?php $id = 'checkbox-' . uniqid(); ?> +<?php // NOTE: `class` is required by favorites list JS ?> +<input + id="<?=$id?>" + class="checkbox-select-item" + type="checkbox" + name="ids[]" + value="<?=$this->id?>" + <?=isset($this->formAttr) ? "form='$this->formAttr'" : ""?> + aria-describedby="<?=$this->id?>" + aria-label="<?=$this->transEsc('select_item')?>" +> +<label for="<?=$id?>"> + <?php if (strlen($this->number ?? '') > 0): ?> + <span class="sr-only"><?=$this->transEsc('result_checkbox_label', ['%%number%%' => $this->number]) ?></span> + <?php endif; ?> +</label> + +<input + type="hidden" + name="idsAll[]" + value="<?=$this->escapeHtmlAttr($this->id) ?>" + <?=isset($this->formAttr) ? "form='$this->formAttr'" : ""?> +> +<!-- fid_bbi: record - checkbox - END --> diff --git a/themes/fid_bbi/templates/search/history.phtml b/themes/fid_bbi/templates/search/history.phtml new file mode 100644 index 0000000000000000000000000000000000000000..9e7db4dc424079ca7576f9fe98da1ce3837ec024 --- /dev/null +++ b/themes/fid_bbi/templates/search/history.phtml @@ -0,0 +1,57 @@ +<!-- fid_bbi - templates - search - history --> +<?php +/** + * Copied from themes/finc/templates/search/history.phtml + * FID BBI specific changes: + * - Clean up HTML + * - Remove usused breadcrumbs and heading levels depending on enabled features + * - Remove sidebar menu + * - Use `translate` instead of `transEsc` for safe strings + * + * @author Tobias Schäfer <ts@aspectis.net> + */ +?> + +<?php +$this->headTitle($this->translate('Search History')); + +$loginEnabled = is_object($account = $this->auth()->getManager()) && $account->loginEnabled(); +$saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled'; +?> + +<h1><?=$this->translate('Search History')?></h1> + +<?=$this->flashmessages()?> + +<div class="results"> + <button class="results_sidebar-toggle" type="button" aria-controls="profile-menu"> + <?=$this->icon('small/person')?> + <span><?=$this->transEsc('Profile Menu')?></span> + </button> + + <div class="results_list -wide"> + <?php if ($saveSupported && !empty($this->saved)): ?> + <h2><?=$this->translate('history_saved_searches')?></h2> + <?=$this->context()->renderInContext('search/history-table.phtml', ['showSaved' => true]);?> + <?php endif; ?> + + <?php if (!empty($this->unsaved)): ?> + <h2><?=$this->translate('history_recent_searches')?></h2> + <?=$this->context()->renderInContext('search/history-table.phtml', ['showSaved' => false]);?> + <p> + <a href="?purge=true"> + <?=$this->translate('history_purge')?> + </a> + </p> + <?php else: ?> + <div class="alert -info"> + <?=$this->icon('small/info')?> + <p><?=$this->translate('history_no_searches')?></p> + </div> + <?php endif; ?> + </div> + + <?php if ($saveSupported): ?> + <?=$this->context($this)->renderInContext('myresearch/menu.phtml', $this->auth()->isLoggedIn() ? ['active' => 'history'] : [])?> + <?php endif; ?> +<!-- fid_bbi - templates - search - history - END -->