From a8364396d454928db0a1e59f57cb8e6d539d8d22 Mon Sep 17 00:00:00 2001
From: Viola Elsenhans <elsenhans@ub.uni-leipzig.de>
Date: Mon, 6 Aug 2018 14:39:49 +0200
Subject: [PATCH] refs #13704 * adapts finc-wide result-list icons from format
 to accessibility of item

---
 local/languages/de.ini                        |   8 +-
 local/languages/en.ini                        |   8 +-
 themes/finc/scss/compiled.scss                |  23 +++
 .../SolrDefault/record-icon-class.phtml       | 139 ++----------------
 .../SolrDefault/record-icon.phtml             |  18 ++-
 5 files changed, 66 insertions(+), 130 deletions(-)

diff --git a/local/languages/de.ini b/local/languages/de.ini
index 2a68b79e1e2..c4fcde43d73 100644
--- a/local/languages/de.ini
+++ b/local/languages/de.ini
@@ -1950,4 +1950,10 @@ Please enter filter term = "Bitte Begriff(e) zum Filtern eingeben"
 Expand all = "Alle ausklappen"
 Expand = "Ausklappen"
 resources_cannot_received = "Fehler aufgetreten. Resourcen konnten nicht geladen werden"
-support_by_dfg = "Die Nationallizenzen wurden gefördert durch die"
\ No newline at end of file
+support_by_dfg = "Die Nationallizenzen wurden gefördert durch die"
+
+; Icon classes for icon display in list view #13704
+(fa-home) = "lokaler Bestand"
+(fa-home object) = "Online-Ressource"
+(fa-globe) = "Online-Ressource"
+(fa-home passive) = "beschaffbar"
diff --git a/local/languages/en.ini b/local/languages/en.ini
index a598c8eef18..6db676eafe6 100644
--- a/local/languages/en.ini
+++ b/local/languages/en.ini
@@ -1886,4 +1886,10 @@ Please enter filter term = "Please enter filter term(s)"
 Expand all = "Expand all"
 Expand = "Expand"
 resources_cannot_received = "Error occurred. List of resources cannot loaded"
-support_by_dfg = "National licenses were sponsored by "
\ No newline at end of file
+support_by_dfg = "National licenses were sponsored by "
+
+; Icon classes for icon display in list view #13704
+(fa-home) = "local holding"
+(fa-home object) = "online resource"
+(fa-globe) = "online resource"
+(fa-home passive) = "available on request"
diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss
index 06ccf732e94..13c446576bd 100644
--- a/themes/finc/scss/compiled.scss
+++ b/themes/finc/scss/compiled.scss
@@ -1393,6 +1393,29 @@ footer {
   }
 }
 
+//// access-icon in resultlist
+.result {
+  .media-left {
+    min-width: 16%;
+    text-align: center;
+  }
+}
+
+.access-icon {
+  color: $brand-primary;
+  text-align: center;
+
+  i {
+    font-size: 4.5em;
+    width: 100%;
+  }
+
+  span {
+    font-size: .8em;
+    width: 100%;
+  }
+}
+
 //// Remaining radiusses - The labels.scss uses no variable and format extends it!
 //// Therefore it will be necessary to overwite here in compiled.scss!!, Fixme when done more elegantly in BS
 //// Also, the display settings aren't very useful (no variables either)
diff --git a/themes/finc/templates/RecordDriver/SolrDefault/record-icon-class.phtml b/themes/finc/templates/RecordDriver/SolrDefault/record-icon-class.phtml
index 853bddddb45..da29dd33594 100644
--- a/themes/finc/templates/RecordDriver/SolrDefault/record-icon-class.phtml
+++ b/themes/finc/templates/RecordDriver/SolrDefault/record-icon-class.phtml
@@ -1,138 +1,23 @@
 <?
 $normalizedValue = preg_replace('/[^a-z0-9]/', '', strtolower($this->value));
+
 // Convert normalizedValue to styles
+// finc: same list of states for icons like in de_15 #13704 - VE
 switch ($normalizedValue) {
-    /*
-    //block general audio
-    case 'audio':
-    case 'musicrecording':
-    case 'record':
-    case 'soundrecordingmedium':
-    case 'electronicsoundrecordingmedium':
-    case 'soundrecording':
-    //block tape audio
-    case 'audiotape':
-    case 'cassette':
-    case 'soundcassette':
-    //block braille
-    case 'braille':
-    //block digital audio
-    case 'cd':
-    case 'dvdaudio':
-    case 'sounddisc':
-    //block digital video
-    case 'dvd':
-    case 'blueraydisc':
-    case 'dvdvideo':
-    case 'videodisc':
-    */
-    //block ebook
-    case 'ebook':
-        echo 'eBook';
+    case 'marcfincpda':
+        echo 'fa-home passive';
         break;
-    //block digital non-book
-    case 'electronicnewspaper':
-    case 'newspaperarticle':
-    case 'newspaper':
-    case 'textresource':
-        echo 'NewspaperArticle';
+    case 'object':
+        echo 'fa-home object';
         break;
-    //block manuscripts
-    case 'manuscript':
-    case 'nachlass':
-        echo 'Dissertation';
+    case 'localholdings':
+        echo 'fa-home';
         break;
-    //block articles
-    case 'article':
-    case 'articlearticle':
-    case 'electronic':
-    case 'electronicarticle':
-    case 'electronicresourcedatacarrier':
-    case 'electronicresourceremoteaccess':
-        echo 'JournalArticle';
+    case 'electronicresources':
+        echo 'fa-globe';
         break;
-    /*
-    //block globe
-    case 'globe':
-    //block kit
-    case 'kit':
-    */
-    //block journal
-    case 'journal':
-    case 'journalnewspaper':
-    case 'serial':
-    //block ejournal
-    case 'electronicjournal':
-    case 'electronicserial':
-        echo 'Journal';
-        break;
-    /*
-    //block map
-    case 'map':
-    case 'atlas':
-    //block microfilm
-    case 'microfilm':
-    case 'microfiche':
-    case 'microform':
-    //block musical score
-    case 'musicalscore':
-    case 'notatedmusic':
-    case 'electronicmusicalscore':
-    //block images
-    case 'photo':
-    case 'artprint':
-    case 'collage':
-    case 'drawing':
-    case 'flashcard':
-    case 'painting':
-    case 'photonegative':
-    case 'placard':
-    case 'print':
-    case 'sensorimage':
-    case 'transparency':
-    //block physical object
-    case 'physicalobject':
-    //block othe rimages
-    case 'sensorimage':
-    case 'chart':
-    //block sets
-    case 'sets':
-    //block slide
-    case 'slide':
-    //block software
-    case 'software':
-    case 'cdrom':
-    case 'chipcartridge':
-    case 'disccartridge':
-    case 'dvdrom':
-    case 'floppydisk':
-    case 'tapecartridge':
-    case 'tapecassette':
-    case 'tapereel':
-    */
-    //block thesis
-    case 'thesis':
-    case 'electronicthesis':
-        echo 'Dissertation';
-        break;
-    /*
-    //block unknown
-    case 'unknown':
-    //block analog video
-    case 'vhs':
-    case 'video':
-    case 'videotape':
-    case 'videocartridge':
-    case 'videocassette':
-    //block film
-    case 'audiovisualmedia':
-    case 'filmstrip':
-    case 'motionpicture':
-    case 'videoreel':
-    */
-    case 'book':
     default:
-        echo 'Book';
+        echo 'fa-book';
         break;
 }
-?>
\ No newline at end of file
+?>
diff --git a/themes/finc/templates/RecordDriver/SolrDefault/record-icon.phtml b/themes/finc/templates/RecordDriver/SolrDefault/record-icon.phtml
index afd96a6e4ce..b6152471e65 100644
--- a/themes/finc/templates/RecordDriver/SolrDefault/record-icon.phtml
+++ b/themes/finc/templates/RecordDriver/SolrDefault/record-icon.phtml
@@ -1,5 +1,7 @@
 <?
-$formats = [];
+/* finc: template is identical with de_15 #13704 - VE */
+
+/*$formats = [];
 foreach ($this->driver->getFormats() as $format) {
   $formats[] = $this->record($this->driver)->getRecordIconClass($format);
 }
@@ -7,3 +9,17 @@ $formats = array_unique($formats);
 asort($formats);
 ?>
 <span class="record-icon"><img src="<?=$this->imageLink("small/".array_pop($formats).".png")?>" class="hidden-xs" alt="<?=$this->transEsc("record icon")?>" /></span>
+*/
+
+if ($this->driver->getRecordType() == "marcfincpda") {
+  $iconClass = $this->record($this->driver)->getRecordIconClass("marcfincpda");
+} elseif ($this->driver->getRecordType() == "lido") {
+  $iconClass = $this->record($this->driver)->getRecordIconClass("object");
+} else {
+  $iconClass = $this->record($this->driver)->getRecordIconClass($this->driver->getAccessFacet());
+}
+?>
+<span class="access-icon hidden-print">
+  <i class="fa <?=$iconClass?>"></i>
+  <span class="hidden-xs"> <?=$this->transEsc("$this->escapeHtml($iconClass)")?></span>
+</span>
-- 
GitLab