Skip to content

Commit

Permalink
[FINNA-2972] Fix status collapse and improve alignment of content. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala authored Dec 18, 2024
1 parent 4a0c143 commit 019c686
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
10 changes: 3 additions & 7 deletions themes/finna2/scss/finna/holdings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
.status-unavailable-icon {
color: $brand-danger;
}
.status-available .icon {
.status-available .status-icon {
color: $brand-success;
}
.status-unavailable .icon {
.status-unavailable .status-icon {
color: $brand-danger;
}
.status-uncertain .icon, .status-unknown .icon {
.status-uncertain .status-icon, .status-unknown .status-icon {
color: $brand-warning;
}
.dedup-select {
Expand Down Expand Up @@ -112,9 +112,6 @@
}
}
}
.available-total {
margin-top: 0.5em;
}
.form-control {
width: 100%;
}
Expand Down Expand Up @@ -502,7 +499,6 @@
float: right;
max-width: 60%;
display: flex;
margin-top: .5em;
margin-left: 2rem;
gap: 0 2rem;
justify-content: right;
Expand Down
79 changes: 43 additions & 36 deletions themes/finna2/templates/Helpers/holding-callnumber.phtml
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
<!-- START of: finna - Helpers/holding-callnumber.phtml -->
<div class="location-link-text">
<?php if ($this->wayfinderLocation): ?>
<span class="js-wayfinder-placeholder" data-location="<?=$this->htmlSafeJsonEncode($wayfinderLocation)?>">
<template class="js-wayfinder-link">
<a class="location-service icon-link__label" target="_blank" href="#">
<?=$this->icon('location-service', 'location-service-icon');?>
<span class="sr-only"><?=$this->transEsc('Location Service')?></span>
</a>
</template>
</span>
<?php endif; ?>
<?php ob_start(); ?>
<?php if ($this->wayfinderLocation): ?>
<span class="js-wayfinder-placeholder" data-location="<?=$this->htmlSafeJsonEncode($wayfinderLocation)?>">
<template class="js-wayfinder-link">
<a class="location-service icon-link__label" target="_blank" href="#">
<?=$this->icon('location-service', 'location-service-icon');?>
<span class="sr-only"><?=$this->transEsc('Location Service')?></span>
</a>
</template>
</span>
<?php endif; ?>

<?php if (isset($this->locationServiceUrl)): ?>
<a class="location-service <?=$this->locationServiceModal ? ' location-service-modal' : ''?>" href="<?=$this->locationServiceUrl?>"<?=$this->locationServiceModal ? ' data-lightbox-href="' . $this->url('locationservice-modal') . '?callnumber=' . urlencode(($this->callnumber instanceof \VuFind\I18n\TranslatableString) ? $this->callnumber->getDisplayString() : $this->callnumber) . '&amp;collection=' . urlencode($this->collection ?? '') . '&amp;location=' . urlencode($this->location ?? '') . '&amp;title=' . urlencode($this->title) . '&amp;source=' . urlencode($this->source) : '' ?>" target="location-service"><?=$this->icon('location-service', 'location-service-icon') ?> <?=$this->transEsc($this->callnumber)?></a>
<?php elseif ($this->callnumber): ?>
<?php if ($this->page === 'results'): ?>
<span class="callnumber-text">
<span><?=$this->transEsc('shelf_location'); ?>: </span><?=$this->transEsc($this->callnumber)?>
</span>
<?php else: ?>
<?=$this->transEsc($this->callnumber)?>
<?php endif; ?>
<?php if (isset($this->locationServiceUrl)): ?>
<a class="location-service <?=$this->locationServiceModal ? ' location-service-modal' : ''?>" href="<?=$this->locationServiceUrl?>"<?=$this->locationServiceModal ? ' data-lightbox-href="' . $this->url('locationservice-modal') . '?callnumber=' . urlencode(($this->callnumber instanceof \VuFind\I18n\TranslatableString) ? $this->callnumber->getDisplayString() : $this->callnumber) . '&amp;collection=' . urlencode($this->collection ?? '') . '&amp;location=' . urlencode($this->location ?? '') . '&amp;title=' . urlencode($this->title) . '&amp;source=' . urlencode($this->source) : '' ?>" target="location-service"><?=$this->icon('location-service', 'location-service-icon') ?> <?=$this->transEsc($this->callnumber)?></a>
<?php elseif ($this->callnumber): ?>
<?php if ($this->page === 'results'): ?>
<span class="callnumber-text">
<span><?=$this->transEsc('shelf_location'); ?>: </span><?=$this->transEsc($this->callnumber)?>
</span>
<?php else: ?>
<?=$this->transEsc($this->callnumber)?>
<?php endif; ?>
<?php endif; ?>

<?php if ($this->qrCode): ?>
<div class="dropdown location-service-qrcode">
<a href="#" class="dropdown-toggle qrcodeLink" data-toggle="dropdown" title="<?=$this->transEsc('QR Code')?>" rel="nofollow">
<?=$this->icon('qrcode', 'location-service-qrcode-icon')?><span class="sr-only"><?=$this->transEsc('QR Code')?></span>
</a>
<ul class="dropdown-menu qrcode" role="menu">
<li>
<script type="text/template" class="qrCodeImgTag">
<img alt="" src="<?=$this->url('qrcode-show', [], ['query' => ['text' => $this->locationServiceUrl]])?>" rel="nofollow">
</script>
</li>
</ul>
</div>
<?php endif; ?>
<?php if ($this->qrCode): ?>
<div class="dropdown location-service-qrcode">
<a href="#" class="dropdown-toggle qrcodeLink" data-toggle="dropdown" title="<?=$this->transEsc('QR Code')?>" rel="nofollow">
<?=$this->icon('qrcode', 'location-service-qrcode-icon')?><span class="sr-only"><?=$this->transEsc('QR Code')?></span>
</a>
<ul class="dropdown-menu qrcode" role="menu">
<li>
<script type="text/template" class="qrCodeImgTag">
<img alt="" src="<?=$this->url('qrcode-show', [], ['query' => ['text' => $this->locationServiceUrl]])?>" rel="nofollow">
</script>
</li>
</ul>
</div>
<?php endif; ?>
<?php
$contentHtml = ob_get_clean();
if (trim($contentHtml)):
?>
<!-- START of: finna - Helpers/holding-callnumber.phtml -->
<div class="location-link-text">
<?=$contentHtml?>
</div>
<!-- END of: finna - Helpers/holding-callnumber.phtml -->
<?php endif;
8 changes: 4 additions & 4 deletions themes/finna2/templates/ajax/status-full.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ if ($groupBranches) {

<?php if ($groupBranches): ?>
<div class="holdings-container root <?=$collapseLocations ? ' collapsible' : ''?>">
<div class="header<?=!empty($availableTotal) ? ' available status-available' : 'status-unavailable'?> clearfix">
<?=!empty($availableTotal) ? $this->icon('status-available') : $this->icon('status-unavailable')?>
<div class="header<?=!empty($availableTotal) ? ' available status-available' : ' status-unavailable'?> clearfix">
<?=$this->icon(!empty($availableTotal) ? 'status-available' : 'status-unavailable', 'status-icon')?>
<span>
<?php if (!empty($availableTotal)): ?>
<?=sprintf('%s %d %s', $this->transEsc('axiell_available'), $availableTotal, $this->transEsc($journal ? 'axiell_issues' : 'axiell_branches'));?>
Expand Down Expand Up @@ -140,7 +140,7 @@ if ($groupBranches) {
<div>
<?php if (!empty($availableTotal)): ?>
<span class="available-total status-available">
<?=$this->icon('status-available')?> <span><?=$this->translate('status_items_available_html', ['%%count%%' => $availableTotal])?></span>
<?=$this->icon('status-available', 'status-icon')?> <span><?=$this->translate('status_items_available_html', ['%%count%%' => $availableTotal])?></span>
</span>
<?php endif; ?>
<span class="info">
Expand Down Expand Up @@ -244,7 +244,7 @@ foreach ($this->statusItems as $item):
<div class="<?=$currentRow % 2 == 0 ? 'even' : 'odd'?> clearfix">
<div class="<?=$groupBranches ? 'group-location-col' : 'no-branches'?>">
<div class="groupLocation <?=$classEsc?><?= $prevOrganisation && $newOrganisation ? ' new-organisation' : ''; ?>">
<?=$icon ? $this->icon($icon) : ''?> <span class="location-name"><?=$locationHtml?></span>
<?=$icon ? $this->icon($icon, 'status-icon') : ''?> <span class="location-name"><?=$locationHtml?></span>
</div>
<?php if ($groupBranches): ?>
</div>
Expand Down

0 comments on commit 019c686

Please sign in to comment.