From 771e81c54650e123fe171afa35857815260cf9cb Mon Sep 17 00:00:00 2001
From: Claas Kazzer <kazzer@ub.uni-leipzig.de>
Date: Wed, 5 Jun 2019 13:37:36 +0200
Subject: [PATCH] refs #15282

* reworks header as flex containers and items
* fixes keep-filters bug for desktop
* turns search tools into proper buttons on SM/XS
* fixes context/hierarchy icon display in default/result-list
* copies solr_ai/result-list over to fid_bdi and fixes icon display there too
* fixes result list display on XS
* improves filter checkbox display on XS
---
 themes/fid_bbi/scss/compiled.scss             | 152 +++++++---
 .../DefaultRecord/result-list.phtml           |   6 +-
 .../RecordDriver/SolrAI/result-list.phtml     | 260 ++++++++++++++++++
 themes/fid_bbi/templates/header.phtml         |  10 +-
 themes/fid_bbi/templates/search/results.phtml |   4 +-
 .../fid_bbi/templates/search/searchbox.phtml  |   8 +-
 6 files changed, 389 insertions(+), 51 deletions(-)
 create mode 100644 themes/fid_bbi/templates/RecordDriver/SolrAI/result-list.phtml

diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss
index 82ad05c238c..f195469cad8 100644
--- a/themes/fid_bbi/scss/compiled.scss
+++ b/themes/fid_bbi/scss/compiled.scss
@@ -5,19 +5,43 @@
 // General
 body {
   hyphens: auto;
+  // Padding to make sure header with "keep filters" doesn't overlap breadcrumbs
+  padding-top: 120px;
 }
 
 .table {
   //no borders fo fid_bbi, cf. #15225
-  border: none;
+  border: 0;
   // make columns adapt to content
   table-layout: auto;
 }
 
+// Helper Classes
+.flex-column {
+  display: flex;
+  flex-flow: column;
+}
+
+.flex-justify-end {
+  justify-content: flex-end;
+}
+
+.flex-self-end {
+  align-self: end;
+}
+
+.flex-item-left {
+  order: -99;
+}
+
+.flex-item-right {
+  order: 99;
+}
+
 // Header
 .navbar {
   background-color: $brand-secondary;
-  min-height: 95px;
+  min-height: 120px;
 
   // Header logo and text
   h1 {
@@ -53,6 +77,7 @@ body {
   flex: 1 1;
 }
 
+// Menu and Language Selector
 // set font color in header to white for better visibility
 .nav {
   a {
@@ -67,6 +92,7 @@ body {
       }
     }
 
+    // Set flags
     &.de::after,
     &.en::after {
       background-position: 50% 30%;
@@ -89,28 +115,16 @@ body {
   }
 }
 
-// Breadcrumbs
-.breadcrumb {
-  padding-top: 23px;
-
-  > li + li::before {
-    color: $white;
-    content: '';
-    padding: 0 5px;
-  }
-
-  a {
-    color: $brand-primary-light;
-
-    &:active {
-      color: $white;
-    }
+// Set right margin for language selector
+.navbar-right {
+  margin-bottom: 3px;
+  margin-right: -10px;
+}
 
-    &:hover {
-      color: $brand-primary-light;
-      text-decoration: underline;
-    }
-  }
+// SEARCH
+// Search Box Wrapper
+.searchbox-wrapper {
+  display: inline-flex;
 }
 
 // Search Box on home page
@@ -140,26 +154,36 @@ body {
   }
 }
 
-// Search Box on all other pages
-.searchbox .searchbox-wrapper {
-    display: inline-flex;
-    position: absolute;
-    right: 10px;
-    top: 45px;
+// Searchbox
+input.searchForm_lookfor {
+  min-width: 250px;
 }
 
-.searchForm {
-  input:not(.shards-checkbox) {
-      min-width: 250px;
-    }
+// Keep Filters and Shards checkbox elements
+input.shards-checkbox,
+input.searchFormKeepFilters {
+  margin: 0 5px 0 0;
+}
+
+.searchForm .flex-checkbox {
+  align-self: end;
+
+  @media screen and (max-width: $screen-xs-max) {
+    align-self: flex-start;
   }
 
-// Shards checkbox elements
-.searchbox .searchForm .checkbox {
+  //border: 1px solid $white;
   color: $white;
   padding: 7px 5px 5px;
-  position: absolute;
-  top: 45px;
+  width: 290px;
+}
+
+// Shards checkbox
+input.shards-checkbox {
+}
+
+// Keep Filters element
+input.searchFormKeepFilters {
 }
 
 .search.container .searchForm .checkbox {
@@ -169,6 +193,31 @@ body {
   }
 }
 
+
+// Breadcrumbs
+.breadcrumb {
+  padding-top: 23px;
+
+  > li + li::before {
+    color: $white;
+    content: '';
+    padding: 0 5px;
+  }
+
+  a {
+    color: $brand-primary-light;
+
+    &:active {
+      color: $white;
+    }
+
+    &:hover {
+      color: $brand-primary-light;
+      text-decoration: underline;
+    }
+  }
+}
+
 // Content
 .searchtools {
   display: block;
@@ -201,15 +250,44 @@ footer {
 }
 
 // result-list
+@media screen and (max-width: $screen-sm-max) {
+  .searchtools {
+    strong {
+      clear: both;
+      display: block;
+      float: none;
+    }
+
+    a {
+      display: inline-block;
+    }
+  }
+}
+
 // result body
 .result-body {
   width: 90%;
+
+  @media screen and (max-width: $screen-xs-max) {
+    float: left;
+  }
 }
+
 // result links
 .result-links {
   width: 10%;
+
+  @media screen and (max-width: $screen-xs-max) {
+    float: right;
+  }
 }
 
+// result list content elements
+.result-formats {
+  margin-right: 1rem;
+}
+
+
 // Avoid ugly wrapping in table headers
 .description-tab > table th {
   min-width: 13rem;
diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml
index 6ff0a9a6d65..e085be91da4 100644
--- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml
+++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/result-list.phtml
@@ -165,7 +165,7 @@ $i = 0;
         <?php if ($this->permission()->allowDisplay('feature.Favorites')): ?>
           <?php /* Add to favorites; finc: keep Icon inside link - CK */ ?>
           <a 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')?>">
-            <i id="fav-icon<?=$this->driver->getUniqueId()?>" class="fa fa-fw fa-star-o fa-2x" aria-hidden="true"></i> <span class="hidden-xs hidden-sm"><?/*=$this->transEsc('Add to favorites')*/?></span>
+            <i id="fav-icon<?=$this->driver->getUniqueId()?>" class="fa fa-fw fa-star-o fa-2x" aria-hidden="true"></i> <span class="sr-only"><?=$this->transEsc('Add to favorites')?></span>
           </a><br/>
         <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?>
           <?=$block?>
@@ -183,8 +183,8 @@ $i = 0;
           <div class="hierarchyTreeLink">
             <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId"/>
             <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree">
-              <i class="result-link-icon fa fa-fw fa-sitemap" aria-hidden="true"></i>
-              <span><?=$this->transEsc('hierarchy_view_context')?></span><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
+              <i class="result-link-icon fa fa-fw fa-sitemap fa-2x" aria-hidden="true"></i>
+              <span class="sr-only"><?=$this->transEsc('hierarchy_view_context')?></span><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
             </a>
           </div>
         <?php endforeach; ?>
diff --git a/themes/fid_bbi/templates/RecordDriver/SolrAI/result-list.phtml b/themes/fid_bbi/templates/RecordDriver/SolrAI/result-list.phtml
new file mode 100644
index 00000000000..45265d6dcf5
--- /dev/null
+++ b/themes/fid_bbi/templates/RecordDriver/SolrAI/result-list.phtml
@@ -0,0 +1,260 @@
+<!-- fid-bbi: recordDriver - SolrAI - result-list -->
+<?php /* compare with DefaultRecord/result-list during upgrades! - CK */
+$coverDetails = $this->record($this->driver)->getCoverDetails('result-list', 'medium', $this->recordLink()->getUrl($this->driver));
+$cover = $coverDetails['html'];
+$thumbnail = false;
+$thumbnailAlignment = $this->record($this->driver)->getThumbnailAlignment('result');
+if ($cover):
+  ob_start(); ?>
+  <div class="media-<?=$thumbnailAlignment?> <?=$this->escapeHtmlAttr($coverDetails['size'])?>">
+    <?=$cover?>
+  </div>
+  <?php $thumbnail = ob_get_contents(); ?>
+  <?php ob_end_clean(); ?>
+  <?php /* Show finc style-based icons; */ ?>
+<?php elseif ($this->record($this->driver)->showStyleBasedIcons()): ?>
+  <?php ob_start(); ?>
+  <div class="media-<?=$thumbnailAlignment?> record-icon">
+    <?=$this->record($this->driver)->getRecordIcon()?>
+  </div>
+  <?php $thumbnail = ob_get_contents(); ?>
+  <?php ob_end_clean(); ?>
+  <?php /* Show finc style-based icons - END */ ?>
+<?php endif; ?>
+
+<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getUniqueID())?>" class="hiddenId"/>
+<input type="hidden" value="<?=$this->escapeHtmlAttr($this->driver->getSourceIdentifier())?>" class="hiddenSource"/>
+<div class="media">
+  <?php if ($thumbnail && $thumbnailAlignment == 'left'): ?>
+    <?=$thumbnail?>
+  <?php endif ?>
+  <div class="media-body">
+    <div class="result-body">
+      <div>
+        <a href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>">
+          <?=$this->record($this->driver)->getTitleHtml()?>
+        </a>
+      </div>
+      <div>
+        <?php if ($this->driver->isCollection()): ?>
+          <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?>
+        <?php else: ?>
+          <?php $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting();
+          if (!empty($summAuthors)): ?>
+            <?=$this->transEsc('by')?>
+            <?php $authorCount = count($summAuthors);
+            foreach ($summAuthors as $i => $summAuthor): ?>
+              <a href="<?=$this->record($this->driver)->getLink('author', $this->highlight($summAuthor, null, true, false))?>" class="author"><?=$this->highlight($summAuthor)?></a><?=$i + 1 < $authorCount ? ',' : ''?>
+            <?php endforeach; ?>
+          <?php endif; ?>
+          <?php /* finc-specific from here - 04.16 - CK */ ?>
+          <?php $journalTitle = $this->driver->getContainerTitle();
+          $summDate = $this->driver->getPublishDateSort(); ?>
+          <?php if (!empty($journalTitle)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?=$this->transEsc('Published in')?>
+            <?php $containerSource = $this->driver->getSourceIdentifier();
+            $containerID = $this->driver->getContainerRecordID();
+            // finc-specific journalLink generation
+            $journalLink = '';
+            $issns = $this->driver->getISSNs();
+
+            // first try to link to container id (VuFind stock-behaviour)
+            if ($containerID) {
+              $journalLink = $this->recordLink()->getUrl("$containerSource|$containerID");
+            } // second try to search issn (finc specific)
+            elseif (!empty($issns)) {
+              $journalLink = $this->record($this->driver)->getLink('isn', $issns);
+            } // third search for journal title (VuFind stock-behaviour)
+            else {
+              $journalLink = $this->record($this->driver)->getLink('journaltitle', str_replace(array('{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'), '', $journalTitle));
+            }
+            ?>
+            <?php /* TODO: handle highlighting more elegantly here: */ ?>
+            <a href="<?=$journalLink?>"><?=$this->highlight($journalTitle)?></a>
+            <?php /* finc-specific -END - 04.16 - CK */ ?>
+            <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
+          <?php elseif (!empty($summDate)): ?>
+            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?php /* finc-specific: nxt line #8639 - CK */ ?>
+            <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?>
+          <?php endif; ?>
+          <?php $summInCollection = $this->driver->getContainingCollections();
+          if (!empty($summInCollection)): ?>
+            <?php foreach ($summInCollection as $collId => $collText): ?>
+              <div>
+                <strong><?=$this->transEsc("in_collection_label")?></strong>
+                <a class="collectionLinkText" href="<?=$this->url('collection', ['id' => $collId])?>?recordID=<?=urlencode($this->driver->getUniqueID())?>">
+                  <?=$this->escapeHtml($collText)?>
+                </a>
+              </div>
+            <?php endforeach; ?>
+          <?php endif; ?>
+        <?php endif; ?>
+      </div>
+
+      <?php if (!$this->driver->isCollection()): ?>
+        <?php if ($snippet = $this->driver->getHighlightedSnippet()): ?>
+          <?php if (!empty($snippet['caption'])): ?>
+            <strong><?=$this->transEsc($snippet['caption'])?>:</strong> ';
+          <?php endif; ?>
+          <?php if (!empty($snippet['snippet'])): ?>
+            <span class="quotestart">&#8220;</span>...<?=$this->highlight($snippet['snippet'])?>...<span class="quoteend">&#8221;</span><br/>
+          <?php endif; ?>
+        <?php endif; ?>
+      <?php endif; ?>
+
+      <?php
+      /* Display information on duplicate records if available */
+      if ($dedupData = $this->driver->getDedupData()): ?>
+        <div class="dedupInformation">
+          <?php
+          $i = 0;
+          foreach ($dedupData as $source => $current) {
+          if (++$i == 1) {
+              ?><span class="currentSource"><a href="<?=$this->recordLink()->getUrl($this->driver)?>"><?=$this->transEsc("source_$source", [], $source)?></a></span><?php
+          } else {
+          if ($i == 2) {
+          ?> <span class="otherSources">(<?=$this->transEsc('Other Sources')?>: <?php
+            } else {
+              ?>, <?php
+            }
+              ?><a href="<?=$this->recordLink()->getUrl($current['id'])?>"><?=$this->transEsc("source_$source", [], $source)?></a><?php
+            }
+            }
+            if ($i > 1) {
+            ?>)</span><?php
+        } ?>
+        </div>
+      <?php endif; ?>
+
+      <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')?>&nbsp;...<br/>
+          </span>
+          <strong><?=$this->transEsc('Located')?>:</strong>
+          <span class="location ajax-availability hidden">
+            <?=$this->transEsc('Loading')?>&nbsp;...
+          </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 endif; ?>
+      </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);
+
+        if ($openUrlActive || $doiActive || !empty($urls)): ?>
+        <?php if ($openUrlActive): ?>
+          <br/>
+          <?=$openUrl->renderTemplate()?>
+        <?php endif; ?>
+        <?php if ($doiActive): ?>
+            <br/>
+            <?=$doi->renderTemplate()?>
+          <?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>
+            <br/>
+          <?php endforeach; ?>
+        <?php endif; ?>
+      <?php endif; ?>
+
+      <div class="result-formats">
+        <?=$this->record($this->driver)->getFormatList()?>
+
+        <?php /* WISO Label - finc-specific - CK */ ?>
+        <?php $sourceID = $this->driver->getSourceID(); ?>
+        <span class="branding label SID<?=($sourceID)?>" title="<?=$this->transEsc("SID$sourceID")?>"></span>
+        <?php /* WISO Label - END */ ?>
+
+        <?php /* nxt line finc-specific: #5737 removed '(!$openUrlActive && empty($urls) &&' - CK */ ?>
+        <?php if ($this->driver->supportsAjaxStatus()): ?>
+          <span class="status ajax-availability hidden">
+          <span class="label label-default"><?=$this->transEsc('Loading')?>&nbsp;...</span>
+        </span>
+        <?php endif; ?>
+      </div>
+
+      <div class="result-previews">
+        <?=$this->record($this->driver)->getPreviews()?>
+      </div>
+    </div>
+    <div class="result-links hidden-print">
+      <?php /* Display qrcode if appropriate: */ ?>
+      <?php if ($QRCode = $this->record($this->driver)->getQRCode("results")): ?>
+        <?php
+// Add JS Variables for QrCode
+          $this->jsTranslations()->addStrings(['qrcode_hide' => 'qrcode_hide', 'qrcode_show' => 'qrcode_show']);
+        ?>
+        <span class="hidden-xs">
+            <i class="fa fa-fw fa-qrcode" aria-hidden="true"></i> <a href="<?=$this->escapeHtmlAttr($QRCode);?>" class="qrcodeLink"><?=$this->transEsc('qrcode_show')?></a>
+          <div class="qrcode hidden">
+            <script type="text/template" class="qrCodeImgTag">
+              <img alt="<?=$this->transEsc('QR Code')?>" src="<?=$this->escapeHtmlAttr($QRCode);?>"/>
+            </script>
+          </div>
+          <br/>
+        </span>
+      <?php endif; ?>
+
+      <?php if ($this->cart()->isActiveInSearch() && $this->params->getOptions()->supportsCart() && $this->cart()->isActive()): ?>
+        <?=$this->render('record/cart-buttons.phtml', ['id' => $this->driver->getUniqueId(), 'source' => $this->driver->getSourceIdentifier()]);?><br/>
+      <?php endif; ?>
+
+      <?php if ($this->userlist()->getMode() !== 'disabled'): ?>
+        <?php /* if ($this->permission()->allowDisplay('feature.Favorites')): */ ?>
+        <?php /* Add to favorites; finc: keep Icon inside link - CK */ ?>
+        <a 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')?>">
+          <i class="result-link-icon fa fa-fw fa-star-o fa-2x" aria-hidden="true"></i> <span class="sr-only"> <?=$this->transEsc('Add to favorites')?></span>
+        </a><br/>
+      <?php elseif ($block = $this->permission()->getAlternateContent('feature.Favorites')): ?>
+        <?=$block?>
+      <?php endif; ?>
+      <?php /* Saved lists */ ?>
+      <div class="savedLists alert alert-info hidden">
+        <strong><?=$this->transEsc("Saved in")?>:</strong>
+      </div>
+      <?php /* endif; */ ?>
+
+      <?php /* Hierarchy tree link; finc: keep Icon inside link - CK */ ?>
+      <?php $trees = $this->driver->tryMethod('getHierarchyTrees');
+      if (!empty($trees)): ?>
+        <?php foreach ($trees as $hierarchyID => $hierarchyTitle): ?>
+          <div class="hierarchyTreeLink">
+            <input type="hidden" value="<?=$this->escapeHtmlAttr($hierarchyID)?>" class="hiddenHierarchyId"/>
+            <a class="hierarchyTreeLinkText result-link-label" data-lightbox href="<?=$this->recordLink()->getTabUrl($this->driver, 'HierarchyTree')?>?hierarchy=<?=urlencode($hierarchyID)?>#tabnav" title="<?=$this->transEsc('hierarchy_tree')?>" data-lightbox-href="<?=$this->recordLink()->getTabUrl($this->driver, 'AjaxTab')?>?hierarchy=<?=urlencode($hierarchyID)?>" data-lightbox-post="tab=hierarchytree">
+              <i class="result-link-icon fa fa-fw fa-sitemap fa-2x" aria-hidden="true"></i> <span class="sr-only"><?=$this->transEsc('hierarchy_view_context')?></span><?php if (count($trees) > 1): ?>: <?=$this->escapeHtml($hierarchyTitle)?><?php endif; ?>
+            </a>
+          </div>
+        <?php endforeach; ?>
+      <?php endif; ?>
+
+      <?=$this->driver->supportsCoinsOpenUrl() ? '<span class="Z3988" title="' . $this->escapeHtmlAttr($this->driver->getCoinsOpenUrl()) . '"></span>' : ''?>
+    </div>
+  </div>
+  <?php if ($thumbnail && $thumbnailAlignment == 'right'): ?>
+    <?=$thumbnail?>
+  <?php endif ?>
+</div>
+<!-- fid-bbi: recordDriver - SolrAI - result-list - END -->
diff --git a/themes/fid_bbi/templates/header.phtml b/themes/fid_bbi/templates/header.phtml
index eba6613369c..ccc9cea35a9 100644
--- a/themes/fid_bbi/templates/header.phtml
+++ b/themes/fid_bbi/templates/header.phtml
@@ -18,16 +18,15 @@
     <h1>
       <a class="navbar-brand lang-<?=$this->layout()->userLang?>" href="<?=$this->url('home')?>">
         <?php /* Custom finc header - CK */ ?>
-          <img src="<?=$this->imageLink('headerlogo.png')?>" class="hidden-xs" alt="Logo <?=$this->transEsc("LibraryName")?>" title="<?=$this->transEsc("LibraryName")?>">
-        <span><?=$this->transEsc("LibraryNameShort")?></span>
+          <img src="<?=$this->imageLink('headerlogo.png')?>" class="hidden-xs" alt="Logo <?=$this->transEsc("LibraryName")?>" title="<?=$this->transEsc("LibraryName")?>"> <span><?=$this->transEsc("LibraryNameShort")?></span>
         <?php /*  Custom finc header - END */ ?>
       </a>
     </h1>
   </div>
 
-  <div class="flex-container">
+  <div class="flex-column">
   <?php if (!isset($this->layout()->renderingError)): ?>
-    <div class="collapse navbar-collapse right" id="header-collapse">
+    <div id="header-collapse" class="collapse navbar-collapse">
       <?php /* finc: right-hand navbar section - see flex-container in SCSS:
               we need this order on XS: navbar-right searchbox
               but reverse it on anything but mobile */ ?>
@@ -83,7 +82,8 @@
     <?php /* finc searchbox: we use searchbox here so it becomes part of the sticky header,
         we need to place this after the navbar-right for anything but mobile  - see flex-container in SCSS:*/ ?>
     <?php if ($this->layout()->searchbox !== false): ?>
-      <div class="search container">
+    <?php /* FID BBI: Do not use .container class here ! - CK */ ?>
+      <div class="search">
         <nav class="nav searchbox hidden-print">
           <?=$this->layout()->searchbox?>
         </nav>
diff --git a/themes/fid_bbi/templates/search/results.phtml b/themes/fid_bbi/templates/search/results.phtml
index 807d881655c..e85ef3a8cce 100644
--- a/themes/fid_bbi/templates/search/results.phtml
+++ b/themes/fid_bbi/templates/search/results.phtml
@@ -60,12 +60,12 @@
         <div class="searchtools hidden-print">
             <strong><?=$this->transEsc('Search Tools')?>:</strong>
             <a href="<?=$this->results->getUrlQuery()->setViewParam('rss')?>"><i class="fa fa-rss" aria-hidden="true"></i> <?=$this->transEsc('Get RSS Feed')?></a>
-            &mdash;
+          <span class="hidden-sm hidden-xs">&mdash;</span>
             <a href="<?=$this->url('search-email')?>" class="mailSearch" data-lightbox id="mailSearch<?=$this->escapeHtmlAttr($this->results->getSearchId())?>">
                 <i class="fa fa-envelope" aria-hidden="true"></i> <?=$this->transEsc('Email this Search')?>
             </a>
             <? if ($this->accountCapabilities()->getSavedSearchSetting() === 'enabled'): ?>
-                &mdash;
+              <span class="hidden-sm hidden-xs">&mdash;</span>
                 <? if (is_numeric($this->results->getSearchId())): ?>
                     <? if ($this->results->isSavedSearch()): ?>
                         <a href="<?=$this->url('myresearch-savesearch')?>?delete=<?=urlencode($this->results->getSearchId())?>"><i class="fa fa-remove" aria-hidden="true"></i> <?=$this->transEsc('save_search_remove')?></a>
diff --git a/themes/fid_bbi/templates/search/searchbox.phtml b/themes/fid_bbi/templates/search/searchbox.phtml
index a14c4c9867d..1dc31d169fb 100644
--- a/themes/fid_bbi/templates/search/searchbox.phtml
+++ b/themes/fid_bbi/templates/search/searchbox.phtml
@@ -45,8 +45,8 @@ $hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->s
       <?php if (!empty($tabs)): ?></div><?php endif; ?>
   </div>
 <?php else: ?>
-  <form id="searchForm" class="searchForm navbar-form flip" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off">
-    <div class="searchbox-wrapper">
+  <form id="searchForm" class="searchForm navbar-form flip flex-column" method="get" action="<?=$this->url($basicSearch)?>" name="searchForm" autocomplete="off">
+    <div class="searchbox-wrapper flex-justify-end">
       <?=$this->context($this)->renderInContext('search/searchTabs', ['searchTabs' => $tabConfig['tabs']]);?>
       <?php $placeholder = $this->searchbox()->getPlaceholderText($tabConfig['selected']['id'] ?? null); ?>
       <?php /* finc: keep "required" */ ?>
@@ -81,7 +81,7 @@ $hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->s
       </ul>
     </div>
     <?php /* finc: We hide this for small and keep the solution using labels, same below - CK */ ?>
-    <div class="checkbox hidden-xs">
+    <div class="flex-checkbox hidden-xs">
       <?php $shards = $options->getShards();
       if ($options->showShardCheckboxes() && !empty($shards)): ?>
         <?php
@@ -106,7 +106,7 @@ $hiddenFilterParams = $this->searchTabs()->getCurrentHiddenFilterParams($this->s
     ?>
     <?php if ((isset($hasDefaultsApplied) && $hasDefaultsApplied) || !empty($filterDetails)): ?>
       <?php $defaultFilterState = $options->getRetainFilterSetting() ? ' checked="checked"' : ''; ?>
-      <div class="checkbox">
+      <div class="flex-checkbox">
         <label>
           <input type="checkbox"<?=$defaultFilterState?> class="searchFormKeepFilters"/>
           <?=$this->transEsc("basic_search_keep_filters")?>
-- 
GitLab