From 47a25b9d6398b2af483ac529d175cfbe3371b765 Mon Sep 17 00:00:00 2001
From: Alexander Purr <purr@ub.uni-leipzig.de>
Date: Wed, 25 Nov 2020 18:43:03 +0100
Subject: [PATCH] refs #18441 [finc: VF5.1] landmarks

* give landmarks translated titles
* moves skip links and intro text inside header
* removes 'Toolbar' title from toolbar.phtml (already in h2 above)

co-authored by: "Claas Kazzer <kazzer@uni-leipzig.de>"
---
 local/languages/de.ini                       |  3 ++
 local/languages/en.ini                       |  5 ++-
 themes/finc/scss/compiled.scss               | 42 +++++++++++---------
 themes/finc/templates/layout/layout.phtml    | 40 ++++++++++---------
 themes/finc/templates/search/searchbox.phtml |  2 +-
 5 files changed, 52 insertions(+), 40 deletions(-)

diff --git a/local/languages/de.ini b/local/languages/de.ini
index 29ae8c90af5..dc6cfa7c850 100644
--- a/local/languages/de.ini
+++ b/local/languages/de.ini
@@ -2050,3 +2050,6 @@ select_item = "Titel auswählen"
 Email = "Mailen"
 Print = "Drucken"
 bookbag_email_selected = "Links zu ausgewählten Medien per E-Mail versenden"
+
+; #18441
+Skip_navigation_links = "Sprunglinks zur Suche und zum Inhalt"
diff --git a/local/languages/en.ini b/local/languages/en.ini
index 962d249c742..be7410d3eeb 100644
--- a/local/languages/en.ini
+++ b/local/languages/en.ini
@@ -2131,4 +2131,7 @@ form-button-submit = "Submit the completed form"
 offcanvas-toggler-search-tips = "Show search help"
 
 ; #18019 remove if using VuFind 7.0
-select_item = "Select item"
\ No newline at end of file
+select_item = "Select item"
+
+; #18441
+Skip_navigation_links = "Skip navigation links"
diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss
index 693a8217d17..2417d81d0df 100644
--- a/themes/finc/scss/compiled.scss
+++ b/themes/finc/scss/compiled.scss
@@ -1540,7 +1540,7 @@ header,
 .search.container {
   padding-right: 0;
 
-  // Make wider to fit searchbox and right-hand nav-elements in
+  // Make wider to fit searchbox and right-hand nav-elements
   @media (min-width: $screen-sm-min) {
     flex: 0 1 auto;
     padding-top: $button-top-padding;
@@ -1550,14 +1550,26 @@ header,
   // Float "Find" button next to searchbox on XS and SM
   @media (max-width: $screen-sm-max) {
     padding-left: 0;
+  }
+
+  @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
+    flex: content;
+  }
+
+  .searchForm_lookfor {
+    @media (max-width: $screen-xs-max) {
+      //max-width: 80%;
+    }
+  }
 
-    .searchForm {
+  .searchForm {
+    @media only screen and (max-width: $screen-sm-max) {
       display: flex;
 
       input {
         flex-grow: 2;
         flex-shrink: 2;
-        max-width: 43%;
+        // max-width: 43%;
       }
 
       .navbar {
@@ -1571,23 +1583,8 @@ header,
         top: 40px;
       }
     }
-  }
-
-  @media only screen and (max-width: $screen-xs-max) {
-    .searchForm_lookfor {
-      max-width: 80%;
-    }
-  }
-
-  @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
-    flex: content;
-
-    .btn,
-    .form-control {
-      float: left;
-    }
 
-    .searchForm {
+    @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
       display: block;
 
       .checkbox {
@@ -1595,6 +1592,13 @@ header,
       }
     }
   }
+
+  .btn,
+  .form-control {
+    @media only screen and (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
+      float: left;
+    }
+  }
 }
 
 //// this will get search box and buttons in line
diff --git a/themes/finc/templates/layout/layout.phtml b/themes/finc/templates/layout/layout.phtml
index 2993ffd55b4..de31a198ebb 100644
--- a/themes/finc/templates/layout/layout.phtml
+++ b/themes/finc/templates/layout/layout.phtml
@@ -153,28 +153,30 @@ if (!isset($this->layout()->searchbox)) {
   $this->layout()->searchbox = $this->render('search/searchbox.phtml');
 }
 ?>
-<?php if (isset($this->layout()->srmessage)): // message for benefit of screen-reader users ?>
-  <span class="sr-only" role="heading" aria-level="1"><?=$this->layout()->srmessage?></span>
-<?php endif; ?>
 
-<?php /* Add landmark role to avoid 'all content must be inside landmarks error', CK */ ?>
-<div role="navigation" aria-label="Skip_navigation_links">
-  <?php /* Show skip to search link only when page is not "advanced" search, CK */ ?>
-  <?php if (strtolower($this->layout()->templateName) !== 'advanced'): ?>
-    <a class="sr-only" href="#searchForm_lookfor"><?=$this->transEsc('Skip to search')?></a>
+<?php /* Move skip links inside header landmark;
+         Start header here, not above, custom finc, CK */ ?>
+<header class="hidden-print">
+  <?php if (isset($this->layout()->srmessage)): // message for benefit of screen-reader users ?>
+    <span class="sr-only" role="heading" aria-level="1"><?=$this->layout()->srmessage?></span>
   <?php endif; ?>
-  <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a>
-  <?php if (substr_count(strtolower($this->layout()->templateName), 'results') > 0): ?>
-    <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?>
-      <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a>
-    <?php else: ?>
-      <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a>
+  
+  <?php /* Add landmark role to avoid 'all content must be inside landmarks error', CK */ ?>
+  <div role="navigation" aria-label="<?=$this->transEsc('Skip_navigation_links')?>">
+    <?php /* Show skip to search link only when page is not "advanced" search, CK */ ?>
+    <?php if (strtolower($this->layout()->templateName) !== 'advanced'): ?>
+      <a class="sr-only" href="#searchForm_lookfor"><?=$this->transEsc('Skip to search')?></a>
     <?php endif; ?>
-  <?php endif; ?>
-</div>
-
-<?php /* Start header here, not above, custom finc, CK */ ?>
-<header class="hidden-print">
+    <a class="sr-only" href="#content"><?=$this->transEsc('Skip to content')?></a>
+    <?php if (substr_count(strtolower($this->layout()->templateName), 'results') > 0): ?>
+      <?php if (strcmp($this->layout()->userLang, 'de') == 0): ?>
+        <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search')?></a>
+      <?php else: ?>
+        <a class="sr-only hidden-xs" href="#myresearch-sidebar"><?=$this->transEsc('skip-to')?><?=strtolower($this->transEsc(isset($this->overrideSideFacetCaption) ? $this->overrideSideFacetCaption : 'Narrow Search'))?></a>
+      <?php endif; ?>
+    <?php endif; ?>
+  </div>
+  
   <?=$this->render('header.phtml')?>
 </header>
 <nav class="breadcrumbs" aria-label="<?=$this->transEsc('Breadcrumbs')?>">
diff --git a/themes/finc/templates/search/searchbox.phtml b/themes/finc/templates/search/searchbox.phtml
index 65f67b30197..0b308f0212f 100644
--- a/themes/finc/templates/search/searchbox.phtml
+++ b/themes/finc/templates/search/searchbox.phtml
@@ -60,7 +60,7 @@ $hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->s
     <?php endif; ?>
     <button type="submit" class="btn btn-primary"><i class="fa fa-search" aria-hidden="true"></i> <span class="find-label sr-only"><?=$this->transEsc("Find")?></span></button>
     <?php if ($advSearch): ?>
-      <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a>
+      <a href="<?=$this->url($advSearch) . ((isset($this->searchId) && $this->searchId) ? '?edit=' . $this->escapeHtmlAttr($this->searchId) : $hiddenFilterParams)?>" class="btn btn-transparent" role="button" rel="nofollow" aria-label="<?=$this->transEsc("Advanced")?>"><i class="fa fa-cog"></i> <span class="hidden-xs hidden-sm hidden-md"><?=$this->transEsc("Advanced")?></span></a>
     <?php endif; ?>
     <?php if ($geoUrl = $this->geocoords()->getSearchUrl($options)) : ?>
       <a href="<?=$geoUrl?>" class="btn btn-link"><?=$this->transEsc('Geographic Search')?></a>
-- 
GitLab