From 246bc216b03d85e61dcd9ca81790ef5f8556c1a6 Mon Sep 17 00:00:00 2001
From: Dorian Merz <merz@ub.uni-leipzig.de>
Date: Thu, 18 Feb 2021 16:53:32 +0100
Subject: [PATCH] refs #19160 [fid_bbi] AMSL-Resource-list refinement

* remove sub-collections for BASE
* alternative styling of AMSL resources list
* add empty source descriptions for English language
* some restyling and scss refactoring
** re-use filters_title style as used in FAQs
** add more bottom padding
** simplify scss
** make link text more specific
** remove magnifier icon
** draw vertical line further
---
 fid_bbi/languages/AMSLScopeNotes/en.ini       |  41 +++++++
 themes/fid_bbi/languages/de.ini               |   3 +
 themes/fid_bbi/languages/en.ini               |   3 +
 themes/fid_bbi/scss/blocks/sources-list.scss  |  25 ++++
 themes/fid_bbi/scss/compiled.scss             |   1 +
 .../fid_bbi/templates/amsl/sources-list.phtml | 115 ++++++++++++++++++
 6 files changed, 188 insertions(+)
 create mode 100644 themes/fid_bbi/scss/blocks/sources-list.scss
 create mode 100644 themes/fid_bbi/templates/amsl/sources-list.phtml

diff --git a/fid_bbi/languages/AMSLScopeNotes/en.ini b/fid_bbi/languages/AMSLScopeNotes/en.ini
index e69de29bb2d..4475933f144 100644
--- a/fid_bbi/languages/AMSLScopeNotes/en.ini
+++ b/fid_bbi/languages/AMSLScopeNotes/en.ini
@@ -0,0 +1,41 @@
+Abendländische mittelalterliche Handschriften = ""
+Abendländische neuzeitliche Handschriften = ""
+BASE = ""
+B3Kat = ""
+Book History Online = ""
+British Library Catalogue (Profil FID BBI) = ""
+British National Bibliography (Profil FID BBI) = ""
+Book Sales Catalogues Online = ""
+Buchhandschriften der UB Leipzig = ""
+DABI Datenbank Deutsches Bibliothekswesen = ""
+Datenbank "Buch und Papier" = ""
+De Gruyter Journals (SSH Social Sciences and Humanities) = ""
+Early English Books Online EEBO = ""
+Early Modern Pamphlets Online (TEMPO) - Dutch Pamphlets [keine Artikel-Metadaten] = 
+Eighteenth Century Collections Online / ECCO = ""
+Emerald Fulltext Archive Database -2014 = ""
+Fragmente = ""
+Gallica Buch- und Bibliothekswissenschaft (BNF) = ""
+GoeScholar - Publikationenserver der Georg-August-Universität Göttingen = ""
+Griechische Handschriften = ""
+Hathi Trust = ""
+HeBIS-Verbundkatalog (Profil FID BBI) = ""
+HeBIS-Verbundkatalog - Bibliographie zum Archivwesen der Archivschule Marburg = ""
+HeBIS-Verbundkatalog - Gutenberg-Museum Mainz = ""
+Hebräische Handschriften = ""
+K10plus Verbundkatalog (FID BBI Profil) = ""
+LISSA = ""
+;media/rep/ - Repositorium für Medienwissenschaft = 
+MedienwRezensionen = ""
+MOnAMi Hochschulschriftenserver Mittweida (Profil FID BBI) = ""
+Morgan & Claypool eBooks (CIS 5, 2013-2014) = ""
+OLC SSG Informations-, Buch- und Bibliothekswesen = ""
+;Olms Online (Altertumswissenschaft) = 
+Qucosa / Buch-, Bibliotheks- und Informationswissenschaften = ""
+Social Theory = ""
+Springer Lecture Notes Archiv 1964-1996 = ""
+;TIB AV-Portal = 
+Torrossa / Monografie = ""
+;Torrossa / Periodici = 
+;Walter de Gruyter Online-Zeitschriften Archiv = 
+Wolfenbütteler Bibliographie zur Geschichte des Buchwesens = ""
diff --git a/themes/fid_bbi/languages/de.ini b/themes/fid_bbi/languages/de.ini
index c3b29182adc..afe496046d7 100644
--- a/themes/fid_bbi/languages/de.ini
+++ b/themes/fid_bbi/languages/de.ini
@@ -51,3 +51,6 @@ home_tagline = Das Nachweisportal für die <br>Buch-, Biblio­theks- und Informa
 licenses_BookHistoryOnline = Bibliographie "Book History Online" bei brill.com
 
 offcanvas-toggler-search-tips = Suchtipps anzeigen
+
+search_in_resource = In dieser Datenquelle suchen
+search_in_specific_resource = In "%%resource%%" suchen
diff --git a/themes/fid_bbi/languages/en.ini b/themes/fid_bbi/languages/en.ini
index 5c547809fe1..5e1704ec530 100644
--- a/themes/fid_bbi/languages/en.ini
+++ b/themes/fid_bbi/languages/en.ini
@@ -26,3 +26,6 @@ home_step_3 = <p>TODO: Translate. Registrieren Sie sich kostenlos für die Nutzu
 home_tagline = TODO: Translate. Das Nachweisportal für die <br>Buch-, Biblio­theks- und Informa­tions­wissen­schaft
 
 licenses_BookHistoryOnline = "Book History Online" bibliography hosted at brill.com
+
+search_in_resource = Search in this data source
+search_in_specific_resource = Search in "%%resource%%"
diff --git a/themes/fid_bbi/scss/blocks/sources-list.scss b/themes/fid_bbi/scss/blocks/sources-list.scss
new file mode 100644
index 00000000000..d2421c67920
--- /dev/null
+++ b/themes/fid_bbi/scss/blocks/sources-list.scss
@@ -0,0 +1,25 @@
+#sources-list li {
+  &::before {
+    position: inherit;
+    margin-left: g(-1) ;
+  }
+  .sub-source-label {
+    font-weight: bold;
+    margin-bottom: g(.5);
+  }
+  > ul {
+    margin-left: g(-1);
+    li {
+      .search-link {
+        color: $link-color;
+        padding-top: g(.5);
+        display: table-cell;
+      }
+      .source-desc {
+        border-left: 2px solid;
+        padding-left: g(.75);
+      }
+    }
+  }
+  padding: 0 g(.5) g(1) 0;
+}
\ No newline at end of file
diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss
index 6b5eca6950b..5de75c79851 100644
--- a/themes/fid_bbi/scss/compiled.scss
+++ b/themes/fid_bbi/scss/compiled.scss
@@ -47,6 +47,7 @@
 @import 'blocks/results';
 @import 'blocks/search';
 @import 'blocks/sidebar';
+@import 'blocks/sources-list';
 @import 'blocks/sr-only';
 @import 'blocks/table';
 @import 'blocks/tabs';
diff --git a/themes/fid_bbi/templates/amsl/sources-list.phtml b/themes/fid_bbi/templates/amsl/sources-list.phtml
new file mode 100644
index 00000000000..676976af177
--- /dev/null
+++ b/themes/fid_bbi/templates/amsl/sources-list.phtml
@@ -0,0 +1,115 @@
+<!-- fid_bbi: amsl/sources-list - home -->
+<?php
+    /**
+     * this is mostly a copy of the finc version
+     * adds special treatment for 'BASE Bielefeld Academic Search Engine'
+     * @deprecated This should be controlled in some more sophisticated way
+     */
+?>
+<?php
+  /* cache fully rendered HTML of THIS template result in AmslController at the first call */
+  if (isset($this->rendered_html)) {
+    echo $this->rendered_html;
+    return;
+  }
+?>
+<!-- finc: amsl/sources-list - home -->
+<?php
+// Set up page title:
+$this->headTitle($this->translate('List of available Sources'));
+
+// Set up breadcrumbs:
+$this->layout()->breadcrumbs .= '</li> <li class="active">' . $this->transEsc('List of available Sources') . '</li>';
+?>
+
+<br />
+<h1><?=$this->transEsc('List of available Sources');?></h1>
+
+<?=$this->flashmessages()?>
+
+<?php if (isset($this->sources)): ?>
+  <p><?=$this->transEsc('sources_explanatory_line');?></p>
+  <form>
+    <div class="form-group">
+      <label for="sources-filter"><?=$this->transEsc('Filter list')?></label>
+      <input type="text" id="sources-filter" class="form-control" placeholder="<?=$this->transEsc('Please enter filter term')?>">
+    </div>
+  </form>
+
+  <p>
+    <button id="collapse-all-toggler" class="btn btn-default" href="javascript:void(0)">
+      <span class="text-collapsed"><?=$this->transEsc('Expand all')?></span>
+      <span class="text-expanded"><?=$this->transEsc('Collapse all')?></span>
+    </button>
+  </p>
+
+  <ul id="sources-list">
+    <?$itemCount = 0;?>
+    <?php foreach ($this->sources as $label => $source): ?>
+      <?php if ($label === 'BASE Bielefeld Academic Search Engine'): ?>
+        <li>
+      <button data-toggle="collapse" class="filters_title collapse-toggler" href="javascript:void(0)">
+          <?=$label?>
+          <?=$this->icon('small/chevron-down')?>
+          <span class="sr-only"><?=$this->transEsc('Expand')?></span>
+      </button>
+      <ul class="panel-collapse collapse" aria-expanded="false">
+        <li>
+          <div class="source-desc">
+            <a class="search-link" title="<?=$this->transEsc("search_in_specific_resource",["%%resource%%" => $this->escapeHtml($label)])?>" href='<?=$this->url('search-results',[],['query'=>['lookfor'=>'mega_collection:BASE - Bielefeld Academic Search Engine']])?>' target="_blank">
+                <?=$this->translate("search_in_resource")?>
+            </a>
+          </div>
+        </li>
+      </ul>
+        </li>
+      <?php elseif (!empty($source)): ?>
+        <li>
+          <button data-toggle="collapse" class="filters_title collapse-toggler">
+            <?=$label?>
+            <?=$this->icon('small/chevron-down')?>
+            <span class="sr-only"><?=$this->transEsc('Expand')?></span>
+          </button>
+          <ul class="panel-collapse collapse" aria-expanded="false">
+            <?php foreach ($source as $sub_label => $collection): ?>
+              <li>
+                  <div class="source-desc">
+                <div class="sub-source-label" tabindex="0" aria-label="<?=$this->transEsc("Source Title")?>">
+                  <?=$sub_label?>
+                </div>
+
+                  <?php if (!empty($collection['desc'])): ?>
+                    <div class="margin-t" tabindex="0" aria-label="<?=$this->transEsc("Description")?>">
+                      <?=$collection['desc']?>
+                    </div>
+                  <?php endif; ?>
+                  <?php if (isset($collection['href'])): ?>
+                    <a class="search-link" title="<?=$this->transEsc("search_in_specific_resource", ["%%resource%%" => $this->escapeHtml($sub_label)])?>" href="<?=$this->escapeHtml($collection['href'])?>" target="_blank">
+                      <?=$this->translate("search_in_resource")?>
+                    </a>
+                  <?php endif; ?>
+                </div>
+              </li>
+            <?php endforeach; ?>
+          </ul>
+        </li>
+      <?php endif; ?>
+    <?php endforeach; ?>
+  </ul>
+
+  <div class="panel panel-primary">
+    <div class="panel-body">
+      <span>
+        <?=$this->transEsc('support_by_dfg');?>
+      </span>
+      <a href='http://www.dfg.de' target='_blank'>
+        <img src='<?=$this->imageLink('dfg_logo_text.png')?>' alt='Deutsche Forschungsgemeinschaft, DFG'>
+      </a>
+    </div>
+  </div>
+<?php endif; ?>
+
+<?php /* run collapse togglers + introduce a case-insensitive filter that is capable of filtering multiple filtering terms */
+echo $this->inlineScript(\Zend\View\Helper\HeadScript::FILE, 'sources-display.js', 'SET');
+?>
+<!-- fid_bbi: amsl/sources-list - home - END -->
\ No newline at end of file
-- 
GitLab