From 2a7f7dca6e857167275b01542e9e1e219682bcdb Mon Sep 17 00:00:00 2001
From: Robert Lange <robert.lange@uni-leipzig.de>
Date: Sat, 14 Nov 2020 12:04:11 +0100
Subject: [PATCH] refs #17407_merge [fid_bbi] amsl resources: add links and
 descriptions

* add Amsl.ini
** set show_link = true
** set show_description = true
** set sub_description_key = 'collection_description'
** add additonal and mispelled resources (alike #16939)
** add info about source id for some allowed collections in facet.ini
** sort by collection label

* change route for resources in header - use Amsl
* add sources-list template for bbi to re-reference finc styles

* Reenable basic finc styles for toggle function
** should be removed after global inheritance etc. of finc
---
 fid_bbi/alpha/config/vufind/Amsl.ini   | 27 ++++++++++
 fid_bbi/config/vufind/Amsl.ini         | 72 ++++++++++++++++++++++++++
 fid_bbi/config/vufind/facets.ini       | 29 +++++++++++
 fid_bbi/languages/en.ini               |  2 +-
 themes/fid_bbi/scss/blocks/toggle.scss | 24 +++++++++
 themes/fid_bbi/scss/compiled.scss      |  1 +
 6 files changed, 154 insertions(+), 1 deletion(-)
 create mode 100644 fid_bbi/alpha/config/vufind/Amsl.ini
 create mode 100644 fid_bbi/config/vufind/Amsl.ini
 create mode 100644 themes/fid_bbi/scss/blocks/toggle.scss

diff --git a/fid_bbi/alpha/config/vufind/Amsl.ini b/fid_bbi/alpha/config/vufind/Amsl.ini
new file mode 100644
index 00000000000..5d3833bffd5
--- /dev/null
+++ b/fid_bbi/alpha/config/vufind/Amsl.ini
@@ -0,0 +1,27 @@
+;####################################################################
+;##################### DO NOT DELETE THIS HEADER ####################
+;################### Leipzig University Library © 2020 ##############
+;
+; This is the default ALPHA-INI-file and inherits
+; all the settings from the INI-file defined in [Parent_Config] which
+; points to the default INI-file located in the folder vufind2/local
+;
+
+[Parent_Config]
+relative_path = ../../../config/vufind/Amsl.ini
+
+; A comma-separated list of config sections from the parent which should be
+; completely overwritten by the equivalent sections in this configuration;
+; any sections not listed here will be merged on a section-by-section basis.
+;override_full_sections = "Languages,AlphaBrowse_Types"
+
+;
+;       Add ALPHA-specific customization after this header.
+;
+;##################### DO NOT DELETE THIS HEADER ####################
+;####################################################################
+
+[API]
+; no caching for alpha
+ttl = 0
+
diff --git a/fid_bbi/config/vufind/Amsl.ini b/fid_bbi/config/vufind/Amsl.ini
new file mode 100644
index 00000000000..4aa2a8cd6cb
--- /dev/null
+++ b/fid_bbi/config/vufind/Amsl.ini
@@ -0,0 +1,72 @@
+;####################################################################
+;##################### DO NOT DELETE THIS HEADER ####################
+;################### Leipzig University Library © 2020 ##############
+;
+; This is the ISIL-instance-specific default INI-file and inherits
+; all the settings from the INI-file defined in [Parent_Config] which
+; points to the default INI-file located in the folder vufind2/local
+;
+
+[Parent_Config]
+;relative_path = ../../../local/config/vufind/Amsl.ini
+
+; A comma-separated list of config sections from the parent which should be
+; completely overwritten by the equivalent sections in this configuration;
+; any sections not listed here will be merged on a section-by-section basis.
+;override_full_sections = "Languages,AlphaBrowse_Types"
+
+;
+;       Add instance-specific customization after this header.
+;
+;##################### DO NOT DELETE THIS HEADER ####################
+;####################################################################
+
+[API]
+;url = "https://live.amsl.technology/inhouseservices/list?do=catalog_metadataList&isil=DE-23"
+;url = "https://live.amsl.technology/outboundservices/list?do=metadata_usage_concat" => source_label and collection_description missing
+url = "https://live.amsl.technology/inhouseservices/list?do=catalog_metadataList&isil=FID-BBI-DE-23"
+response_type = 'application/json'
+; max caching in milliseconds
+ttl = 604800
+
+; Contains label patterns for two layers of source hierarchy
+; these will normally be source and collection represented by main_label and sub_label, resp.
+; use array_keys in double percent signs to be rendered in the labels
+; the main label MUST contain the main key and the main key SHOULD identify the source
+; same for the sub key and label
+[Mapping]
+main_key = 'source_id'
+main_label = '%%source_label%%'
+sortBySourceLabel = true
+default_main_label = 'untitled source'
+sub_key = 'collection_label'
+sub_label = '%%collection_label%%'
+default_sub_label = 'untilted collection'
+show_link = true
+show_description = true
+sub_description_key = 'collection_description'
+
+[AdditionalResources]
+; mega_collection = source_id
+
+[MisspelledResources]
+; wrong collection label = correct collection label for links
+; "" means no link
+Eighteenth Century Collection Online / ECCO = "Eighteenth Century Collections Online / ECCO"
+Springer Lecture Notes Archiv 1964-1996 = "Springer Lecture Notes"
+Gallica Buch- und Bibliothekswissenschaft = "Gallica (BNF)"
+Qucosa / Buch-, Bibliotheks- und Informationswissenschaften = "Qucosa"
+De Gruyter Journals = "De Gruyter Journals / Social Sciences and Humanities"
+Claypool eBooks = ""
+BASE Meta-Kollektion = "BASE - Bielefeld Academic Search Engine"
+MOnAMi Hochschulschriftenserver Mittweida = "MOnAMi Hochschulschriftenserver Mittweida"
+Abendländische mittelalterliche Handschriften = "Digitale Sammlungen UBL / Abendländische mittelalterliche Handschriften"
+Abendländische neuzeitliche Handschriften = "Digitale Sammlungen UBL / Abendländische neuzeitliche Handschriften"
+Fragmente = "Digitale Sammlungen UBL / Fragmente"
+Griechische Handschriften = "Digitale Sammlungen UBL / Griechische Handschriften"
+Hebräische Handschriften = "Digitale Sammlungen UBL / Hebräische Handschriften"
+British National Bibliography = "British National Bibliography"
+British Library Catalogue = "British Library Catalogue"
+K10plus Verbundkatalog = "K10plus Verbundkatalog"
+HeBIS-Verbundkatalog - Gutenberg-Museum Mainz = "Gutenberg-Bibliothek des Gutenberg-Museums Mainz"
+HeBIS-Verbundkatalog - Bibliographie zum Archivwesen der Archivschule Marburg = "Bibliographie zum Archivwesen der Archivschule Marburg"
diff --git a/fid_bbi/config/vufind/facets.ini b/fid_bbi/config/vufind/facets.ini
index 5cfd6ff4b11..a9fb2d5bfdd 100644
--- a/fid_bbi/config/vufind/facets.ini
+++ b/fid_bbi/config/vufind/facets.ini
@@ -81,17 +81,25 @@ language[] = "not assigned"
 facet_avail[]   = "Non-free"
 
 [AllowFacetValue]
+;source_id[] = 17
 mega_collection[] = "Social Theory"
 mega_collection[] = "Springer Lecture Notes"
 ;mega_collection[] = "Torrossa / Monografie"
 ;mega_collection[] = "de Gruyter Online-Zeitschriften [Archiv]"
 ;mega_collection[] = "de Gruyter Online-Zeitschriften / Linguistics, Literature and Humanities"
+;source_id[] = 190
 mega_collection[] = "Early English Books Online"
+;source_id[] = 17
 mega_collection[] = "Eighteenth Century Collections Online / ECCO"
+;source_id[] = 20
 mega_collection[] = "Gallica (BNF)"
+;source_id[] = 22
 mega_collection[] = "Qucosa"
+;source_id[] = 35
 mega_collection[] = "Hathi Trust"
+; ???
 mega_collection[] = "Morgan & Claypool eBooks (CIS 5, 2013-2014)"
+;source_id[] = 73
 mega_collection[] = "MedienwRezensionen"
 ;mega_collection[] = "Torrossa / Periodici"
 ;mega_collection[] = "Early Modern Pamphlets Online"
@@ -99,22 +107,37 @@ mega_collection[] = "MedienwRezensionen"
 ;mega_collection[] = "TIB AV-Portal"
 ;mega_collection[] = "Olms Online"
 ; aus Ticket #15891:
+;source_id[] = 183
 mega_collection[] = "K10plus"
+; ???
 mega_collection[] = "DeGruyter SSH"
+;source_id[] = 173
 mega_collection[] = "Wolfenbütteler Bibliographie zur Geschichte des Buchwesens"
+;source_id[] = 179
 ;"LISSA - LIS Scholarship Archive"
 mega_collection[] = "LISSA"
+; ???
 mega_collection[] = "VD17"
+; ???
 mega_collection[] = "VD18"
+;source_id[] = 186
 ;mega_collection[] = "Datenbank Buch und Papier"
 mega_collection[] = "Datenbank \"Buch und Papier\""
+; ???
 mega_collection[] = "HPB - Heritage of the Printed Book Database"
+;source_id[] = 185
 mega_collection[] = "DABI Datenbank Deutsches Bibliothekswesen"
+; ???
 mega_collection[] = "English Short Title Catalogue (ESTC)"
+; ???
 mega_collection[] = "Incunabula Short Title Catalogue (ISTC)"
+; ???
 mega_collection[] = "Catalogue of Illuminated Manuscripts"
+; ???
 mega_collection[] = "BBB (Bibliographie der Buch- und Bibliotheksgeschichte)"
+; ???
 mega_collection[] = "Digitised Manuscripts"
+; ???
 mega_collection[] = "Database of Bookbindings"
 ;mega_collection[] = "GoeScholar"
 ;Buchhandschriften der UB Leipzig
@@ -141,14 +164,20 @@ mega_collection[] = "K10plus Verbundkatalog"
 mega_collection[] = "GoeScholar - Publikationenserver der Georg-August-Universität Göttingen"
 
 ; #16064
+;source_id[] = 150
 mega_collection[] = "MOnAMi Hochschulschriftenserver Mittweida"
 
+;source_id[] = 68
 mega_collection[] = "OLC SSG Informations-, Buch- und Bibliothekswesen"
 ;mega_collection[] = "Torrossa / Periodici"
 ;mega_collection[] = "Emerald Fulltext Archive Database"
+; ???
 mega_collection[] = "Early Modern Pamphlets Online"
+; ???
 mega_collection[] = "TIB AV-Portal"
+; ???
 mega_collection[] = "Olms Online"
+;source_id[] = 181
 mega_collection[] = "British Library Bibliography"
 
 ; #17395
diff --git a/fid_bbi/languages/en.ini b/fid_bbi/languages/en.ini
index 1046d701da2..600cf526ac3 100644
--- a/fid_bbi/languages/en.ini
+++ b/fid_bbi/languages/en.ini
@@ -17,7 +17,7 @@
 ;####################################################################
 
 About Us = "About Us"
-Data Collection = "Data Collections"
+Data Collection = "List of queryable metadata sources"
 Author = "Person / Institution"
 Availability = "Access"
 Email this Search = "E-Mail this"
diff --git a/themes/fid_bbi/scss/blocks/toggle.scss b/themes/fid_bbi/scss/blocks/toggle.scss
new file mode 100644
index 00000000000..fe625f40337
--- /dev/null
+++ b/themes/fid_bbi/scss/blocks/toggle.scss
@@ -0,0 +1,24 @@
+// #17407 change text of button when expanded / collapsed
+#collapse-all-toggler:not(.expanded) .text-expanded {
+  display: none;
+}
+#collapse-all-toggler.expanded .text-collapsed {
+  display: none;
+}
+
+.collapse {
+  display: none;
+
+  &.in      { display: block; }
+  // [converter] extracted tr&.in to tr.collapse.in
+  // [converter] extracted tbody&.in to tbody.collapse.in
+}
+
+.collapsing[aria-expanded='true'] {
+  display: block;
+}
+
+.collapsing[aria-expanded='false'] {
+  display: none;
+}
+
diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss
index 7239fa7a57c..741f2e23e9c 100644
--- a/themes/fid_bbi/scss/compiled.scss
+++ b/themes/fid_bbi/scss/compiled.scss
@@ -50,6 +50,7 @@
 @import 'blocks/sr-only';
 @import 'blocks/tabs';
 @import 'blocks/tagline';
+@import 'blocks/toggle';
 @import 'blocks/tooltip';
 @import 'blocks/to-top';
 @import 'blocks/unstyled-list';
-- 
GitLab