From d383d872d1d8764cc10dccc99ca31d8b3bc98554 Mon Sep 17 00:00:00 2001
From: Viola Elsenhans <elsenhans@ub.uni-leipzig.de>
Date: Tue, 19 Jul 2022 12:42:13 +0200
Subject: [PATCH] refs #19396 [finc] change div to h2 for record title

* add header element for tite and author
---
 themes/finc/scss/compiled.scss                | 12 ++++++++++
 .../DefaultRecord/result-list.phtml           | 21 +++++++++++-------
 .../FincMissing/result-list.phtml             | 16 ++++++++------
 .../RecordDriver/SolrAI/result-list.phtml     | 22 ++++++++++++-------
 4 files changed, 48 insertions(+), 23 deletions(-)

diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss
index 45d397b30f4..12a4e2b53db 100644
--- a/themes/finc/scss/compiled.scss
+++ b/themes/finc/scss/compiled.scss
@@ -1998,6 +1998,18 @@ footer {
 }
 
 //// Search results
+.result-body {
+  h2 {
+    margin: 0;
+  }
+}
+
+// re-define header for records in list of result, #19396
+header {
+  background-color: transparent;
+  width: auto;
+}
+
 //// Add top padding to sidebar and content for better looks;
 .mainbody,
 .sidebar {
diff --git a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml
index 3ec38ca856e..e444addd9f7 100644
--- a/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml
+++ b/themes/finc/templates/RecordDriver/DefaultRecord/result-list.phtml
@@ -32,14 +32,17 @@ if ($cover):
   <?php endif ?>
   <div class="media-body">
     <div class="result-body">
-      <div>
-        <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
-          <?=$this->record($this->driver)->getTitleHtml()?>
-        </a>
-      </div>
+      <?php /* finc: add header element for title and author; use h2 for record title; #19396 */ ?>
+      <header>
+        <h2>
+          <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
+            <?=$this->record($this->driver)->getTitleHtml()?>
+          </a>
+        </h2>
 
-      <div>
         <?php if ($this->driver->isCollection()): ?>
+          </header>
+          <div>
           <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?>
         <?php else: ?>
           <?php $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting();
@@ -50,13 +53,15 @@ if ($cover):
               <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; ?>
+          </header>
+          <div>
           <?php
           /* finc-specific from here, #8639, #7345 - CK */
           /* finc-specific: nxt line #8639 - CK */ ?>
           <?php $journalTitle = $this->driver->getContainerTitle();
           $summDate = $this->driver->getPublishDateSort(); ?>
           <?php if (!empty($journalTitle)): ?>
-            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?php /* finc: remove linebreak #19396 */ ?>
             <?=$this->transEsc('Published in')?>
             <?php $containerSource = $this->driver->getSourceIdentifier(); ?>
             <?php $containerID = $this->driver->getContainerRecordID(); ?>
@@ -65,7 +70,7 @@ if ($cover):
             <?php /* finc-specific: nxt line #8639 - CK */ ?>
             <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
           <?php elseif (!empty($summDate)): ?>
-            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?php /* finc: remove linebreak #19396 */ ?>
             <?php /* finc-specific: nxt line #8639 - CK */ ?>
             <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?>
           <?php endif; ?>
diff --git a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml
index d6edbf31147..025825b978b 100644
--- a/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml
+++ b/themes/finc/templates/RecordDriver/FincMissing/result-list.phtml
@@ -37,13 +37,15 @@ if ($cover):
   <?php endif ?>
   <div class="media-body">
     <div class="result-body">
-      <div>
-        <?php /* We don't use links for missing records as they would lead nowhere - CK */ ?>
-        <span href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
-          <?=$this->record($this->driver)->getTitleHtml()?>
-        </span>
-      </div>
-
+      <?php /* finc: add header element and use h2 for record title #19396 */ ?>
+      <header>
+        <h2>
+          <?php /* We don't use links for missing records as they would lead nowhere - CK */ ?>
+          <span href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
+            <?=$this->record($this->driver)->getTitleHtml()?>
+          </span>
+        </h2>
+      </header>
 
       <?php /* We don't display formats nor previews nor other details for missing records - CK */ ?>
 
diff --git a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
index 6b0dbed4c44..5c6d0877349 100644
--- a/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
+++ b/themes/finc/templates/RecordDriver/SolrAI/result-list.phtml
@@ -31,13 +31,17 @@ if ($cover):
   <?php endif ?>
   <div class="media-body">
     <div class="result-body">
-      <div>
-        <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
-          <?=$this->record($this->driver)->getTitleHtml()?>
-        </a>
-      </div>
-      <div>
+      <?php /* finc: add header element and use h2 for record title #19396 */ ?>
+      <header>
+        <h2>
+          <a id="<?=$describedById?>" href="<?=$this->recordLink()->getUrl($this->driver)?>" class="title getFull" data-view="<?=$this->params->getOptions()->getListViewOption()?>" lang="">
+            <?=$this->record($this->driver)->getTitleHtml()?>
+          </a>
+        </h2>
+
         <?php if ($this->driver->isCollection()): ?>
+          </header>
+          <div>
           <?=implode('<br>', array_map([$this, 'escapeHtml'], $this->driver->getSummary())); ?>
         <?php else: ?>
           <?php $summAuthors = $this->driver->getPrimaryAuthorsWithHighlighting();
@@ -48,11 +52,13 @@ if ($cover):
               <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; ?>
+          </header>
+          <div>
           <?php /* finc-specific from here - 04.16 - CK */ ?>
           <?php $journalTitle = $this->driver->getContainerTitle();
           $summDate = $this->driver->getPublishDateSort(); ?>
           <?php if (!empty($journalTitle)): ?>
-            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?php /* finc: remove linebreak #19396 */ ?>
             <?=$this->transEsc('Published in')?>
             <?php $containerSource = $this->driver->getSourceIdentifier();
             $containerID = $this->driver->getContainerRecordID();
@@ -76,7 +82,7 @@ if ($cover):
             <?php /* finc-specific -END - 04.16 - CK */ ?>
             <?=!empty($summDate) ? ' (' . $this->escapeHtml($summDate) . ')' : ''?>
           <?php elseif (!empty($summDate)): ?>
-            <?=!empty($summAuthor) ? '<br />' : ''?>
+            <?php /* finc: remove linebreak #19396 */ ?>
             <?php /* finc-specific: nxt line #8639 - CK */ ?>
             <?=$this->transEsc('Published') . ' ' . $this->escapeHtml($summDate)?>
           <?php endif; ?>
-- 
GitLab