Skip to content

Commit

Permalink
Tweak holdings tables for better looks and forward-compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed Dec 17, 2024
1 parent 8e56798 commit c68a23b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 34 deletions.
28 changes: 16 additions & 12 deletions themes/finna2/scss/finna/external-data.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
width: 100%;
border: 1px $gray-lighter solid;

.fa-chevron-up, .fa-chevron-down {
font-size: .80em;
vertical-align: middle;
}
&.collapsible {
.toggle-collapse {
display: flex;
align-self: center;
}
.toggle-expand {
display: none;
}
&.collapsed {
.toggle-collapse {
display: none;
}
.toggle-expand {
display: initial;
}
}
.toggle-collapse {
display: none;
}
.toggle-expand {
display: flex;
align-self: center;
}
}
}

thead {
Expand All @@ -38,6 +39,10 @@
}
&.external-data-headers {
padding-left: 5px;
.icon-link__icon {
font-size: 0.8rem;

}
}
&:nth-child(even):not(.info) {
background-color: $gray-ultralight;
Expand All @@ -49,7 +54,6 @@
&.tbl-left {
float: left;
width: 40%;
font-size: 1.5m;
font-weight: 600;
}
&.tbl-right {
Expand Down
4 changes: 2 additions & 2 deletions themes/finna2/scss/finna/reservationlist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
}
.reservation-request-table {
.reservation-request-buttons {
padding: 10px 15px;
display: flex;
align-items: center;
justify-content: start;
Expand All @@ -67,8 +68,7 @@
}
}
.saved-reservation-lists {
padding: 4px;
margin: 2px;
padding: 10px 15px;
}
}

Expand Down
22 changes: 12 additions & 10 deletions themes/finna2/templates/Helpers/reservationlist-reserve.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ return;
<?php
$user = $this->auth()->getManager()->getUserObject();
?>
<div class="record-holdings-table table reservation-request-table">
<div class="record-holdings-table reservation-request-table">
<div class="headers">
<span class="holdings-title"><?=$this->transEsc('ReservationList::Add To Reservation List')?></span>
</div>
Expand All @@ -31,15 +31,17 @@ return;
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ($listsContainingRecord = $this->reservationList($user)->getListsContainingRecord($this->driver)): ?>
<div class="saved-reservation-lists alert-info savedLists loaded">
<strong><?=$this->transEsc('Saved in')?>:</strong><br/>
<ul>
<?php foreach ($listsContainingRecord as $list): ?>
<li>
<a href="<?= $this->url('reservationlist-displaylist', ['id' => $list->getId()]) ?>"><?= $this->escapeHtml($list->getTitle()); ?></a><br/>
</li>
<?php endforeach; ?>
</ul>
<div class="holdings-group saved-reservation-lists">
<div class="alert-info savedLists loaded">
<strong><?=$this->transEsc('Saved in')?>:</strong><br/>
<ul>
<?php foreach ($listsContainingRecord as $list): ?>
<li>
<a href="<?= $this->url('reservationlist-displaylist', ['id' => $list->getId()]) ?>"><?= $this->escapeHtml($list->getTitle()); ?></a><br/>
</li>
<?php endforeach; ?>
</ul>
</div>
</div>
<?php endif; ?>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
?>

<div class="table record-holdings-url-table">
<div class="record-holdings-url-table">
<div class="headers">
<span class="holdings-url-title"><?=$this->transEsc('Links')?></span>
</div>
Expand Down
12 changes: 6 additions & 6 deletions themes/finna2/templates/RecordTab/holdingsarchive.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<?php if ($this->driver->tryMethod('archiveRequestAllowed')): ?>
<?php $user = $this->auth()->getManager()->getUserObject(); ?>
<!-- Display lists where it has been saved: -->
<div class="reservation-request-table table record-holdings-url-table">
<div class="reservation-request-table record-holdings-url-table">
<div class="headers">
<span class="holdings-url-title"><?=$this->transEsc('ReservationList::Reserve to Research Room')?></span>
</div>
Expand All @@ -17,7 +17,7 @@
</div>
<?php endif;?>
<br>
<?= $this->reservationList($this->auth()->getUserObject())->renderReserveTemplate($driver); ?>
<?= $this->reservationList($this->auth()->getUserObject())->renderReserveTemplate($driver); ?>

<?= $this->render('RecordTab/holdings-record-urls'); ?>

Expand Down Expand Up @@ -57,10 +57,10 @@

<div class="external-data-heading external-data physical-items collapsible <?=$collapsed?>" role="table">
<div role="row" class="tbl-row external-data-headers">
<div role="cell" class="tbl-cell tbl-left">
<?=$this->icon('collapse-open', ['class' => 'toggle-expand'])?>
<?=$this->icon('collapse-close', ['class' => 'toggle-collapse'])?>
<span role="columnheader"><?=$this->escapeHtml($format)?></span>
<div role="cell" class="tbl-cell tbl-left icon-link">
<?=$this->icon('collapse-open', 'toggle-expand icon-link__icon')?>
<?=$this->icon('collapse-close', 'toggle-collapse icon-link__icon')?>
<span role="columnheader" class="icon-link__label"><?=$this->escapeHtml($format)?></span>
<?php if (!empty($item['imageType'])): ?>
<div class="format-info"><?=$this->transEsc('holdings_archive_tab_image_type')?>: <?=$this->escapeHtml($item['imageType'])?></div>
<?php endif;?>
Expand Down
4 changes: 2 additions & 2 deletions themes/finna2/templates/RecordTab/holdingsils.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
?>
<?php endif; ?>

<div class="table record-holdings-table">
<div class="record-holdings-table">
<div class="headers">
<?php $mergedData = $this->driver->tryMethod('getMergedRecordData'); ?>
<?php $recordSourceId = $this->driver->getSourceIdentifier(); ?>
Expand Down Expand Up @@ -390,7 +390,7 @@

<?php $history = $this->driver->getRealTimeHistory(); ?>
<?php if (is_array($history) && !empty($history)): ?>
<table class="table record-holdings-table">
<table class="record-holdings-table">
<tr>
<th class="headers"><span class="holdings-title"><?=$this->transEsc('Most Recent Received Issues')?></span></th>
</tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- START of: finna - RecordTab/holdingsils/electronic.phtml -->
<div class="table record-holdings-table electronic-holdings">
<div class="record-holdings-table electronic-holdings">
<div class="headers">
<span class="holdings-title"><?=$this->transEsc('Electronic')?></span>
</div>
Expand Down

0 comments on commit c68a23b

Please sign in to comment.