From 330246de67544e1d9753e2819b59588a99d9ce28 Mon Sep 17 00:00:00 2001 From: Viola Elsenhans <elsenhans@ub.uni-leipzig.de> Date: Tue, 17 Jul 2018 17:24:35 +0200 Subject: [PATCH] refs #13606 * change structure of holdings-tab * adapt layout holdings-tab --- themes/finc/scss/compiled.scss | 29 +++-- .../templates/RecordTab/holdingsils.phtml | 105 +++++++++--------- 2 files changed, 75 insertions(+), 59 deletions(-) diff --git a/themes/finc/scss/compiled.scss b/themes/finc/scss/compiled.scss index 13c446576bd..dc2952b7b0e 100644 --- a/themes/finc/scss/compiled.scss +++ b/themes/finc/scss/compiled.scss @@ -157,13 +157,15 @@ h3 { } // Remove top borders (_tables.scss) -thead, -tbody, -tfoot { - > tr { - > th, - > td { - border-top: 0; +.table { + thead, + tbody, + tfoot { + > tr { + > th, + > td { + border-top: 0; + } } } } @@ -248,6 +250,19 @@ legend { //// label {} +.text-success, +.text-danger { + padding: .5em; +} + +.text-success { + background-color: $brand-success; +} + +.text-danger { + background-color: $brand-danger; +} + //// Required symbol .required { diff --git a/themes/finc/templates/RecordTab/holdingsils.phtml b/themes/finc/templates/RecordTab/holdingsils.phtml index 2c9dc684c82..f17b7b966cb 100644 --- a/themes/finc/templates/RecordTab/holdingsils.phtml +++ b/themes/finc/templates/RecordTab/holdingsils.phtml @@ -102,29 +102,7 @@ if (!empty($holdingTitleHold)): ?> <table class="table table-striped"> <? /* Table summary not supported in html 5, finc-specific solution, CK */ ?> <caption class="sr-only"><?=$this->transEsc('holdings_details_from', ['%%location%%' => $this->transEsc($holding['location'])]) ?></caption> - <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); - if (!empty($callNos)): ?> - <tr> - <th><?=$this->transEsc("Call Number")?>:</th> - <td> - <? /* finc: no links back to alphabrows here - CK */ ?> - <? foreach ($callNos as $callNo): ?> - <?=$this->escapeHtml($callNo)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endif; ?> - <? if (isset($holding['textfields'])): foreach ($holding['textfields'] as $textFieldName => $textFields): ?> - <tr> - <? // Translation for summary is a special case for backwards-compatibility ?> - <th><?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>:</th> - <td> - <? foreach ($textFields as $current): ?> - <?=$this->escapeHtml($current)?><br/> - <? endforeach; ?> - </td> - </tr> - <? endforeach; endif; ?> + <? /* finc: change order and structure of table #13606 - VE */ ?> <? foreach ($holding['items'] as $row): ?> <? // AJAX Check record? @@ -137,8 +115,8 @@ if (!empty($holdingTitleHold)): ?> ?> <? if (isset($row['barcode']) && $row['barcode'] != ""): ?> <tr vocab="http://schema.org/" typeof="Offer"> - <th><?=$this->transEsc("Copy")?> <?=$this->escapeHtml($row['number'])?></th> - <td> + <? /* finc: remove transEsc("Copy") with number #13606 - VE */ ?> + <td class="availability-column"> <? if ($row['reserve'] == "Y"): ?> <link property="availability" href="http://schema.org/InStoreOnly"/> <?=$this->transEsc("On Reserve - Ask at Circulation Desk")?><br/> @@ -146,27 +124,29 @@ if (!empty($holdingTitleHold)): ?> <? if (isset($row['use_unknown_message']) && $row['use_unknown_message']): ?> <span class="text-muted"><?=$this->transEsc("status_unknown_message")?></span> <? else: ?> - <? if ($row['availability']): ?> - <? /* Begin Available Items (Holds) */ ?> - <span class="text-success"><?=$this->transEsc("Available")?> - <link property="availability" href="http://schema.org/InStock"/></span> - <? if (isset($row['link']) && $row['link']): ?> - <? /* finc: add class .hidden-print + add title, CK */ ?> - <a class="<?=$check ? 'checkRequest ' : ''?>placehold hidden-print" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a> - <? endif; ?> + </td> + <td> + <? if ($row['availability']): ?> + <? /* Begin Available Items (Holds) */ ?> + <span class="text-success"><?=$this->transEsc("Available")?> + <link property="availability" href="http://schema.org/InStock"/></span> + <? if (isset($row['link']) && $row['link']): ?> + <? /* finc: add class .hidden-print + add title, CK */ ?> + <a class="<?=$check ? 'checkRequest ' : ''?>placehold hidden-print" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>" title="<?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a> + <? endif; ?> <? if (isset($row['storageRetrievalRequestLink']) && $row['storageRetrievalRequestLink']): ?> <a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest ' : ''?> placeStorageRetrievalRequest" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['storageRetrievalRequestLink'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?></a> - <? endif; ?> - <? /* finc-specific additional insert - #6096 - CK */ ?> - <? if (isset($row['emailHoldLink']) && $row['emailHoldLink']): ?> - <a class="<?=$checkEmailHold ? 'checkEmailHold ' : ''?>placeEmailHold " data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['emailHoldLink'])?>" title="<?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?>"><i class="fa fa-flag"></i> <?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?></a> - <? endif; ?> + <? endif; ?> + <? /* finc-specific additional insert - #6096 - CK */ ?> + <? if (isset($row['emailHoldLink']) && $row['emailHoldLink']): ?> + <a class="<?=$checkEmailHold ? 'checkEmailHold ' : ''?>placeEmailHold " data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['emailHoldLink'])?>" title="<?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?>"><i class="fa fa-flag"></i> <?=$this->transEsc($checkEmailHold ? "EmailHold::email_hold_check_text" : "EmailHold::email_hold_place_text")?></a> + <? endif; ?> <? /* finc-specific insert - #6096 - END */ ?> <? else: ?> <? /* Begin Unavailable Items (Recalls) */ ?> <? /* finc: use empty row status and transEsc 'Unavailable', CK */ ?> <span class="text-danger"><?=empty($row['status']) ? $this->transEsc("Unavailable") : $this->transEsc($row['status'])?> - <link property="availability" href="http://schema.org/OutOfStock"/></span> + <link property="availability" href="http://schema.org/OutOfStock"/></span> <? if (isset($row['returnDate']) && $row['returnDate']): ?>– <span><?=$this->escapeHtml($row['returnDate'])?></span><? endif; ?> <? if (isset($row['duedate']) && $row['duedate']): ?> <? /* finc: keep nbsp + ndash or due date text will bump into alert, CK */ ?> @@ -175,22 +155,22 @@ if (!empty($holdingTitleHold)): ?> <? if (isset($row['requests_placed']) && $row['requests_placed'] > 0): ?> <span><?=$this->transEsc("Requests")?>: <?=$this->escapeHtml($row['requests_placed'])?></span> <? endif; ?> - <? if (isset($row['link']) && $row['link']): ?> - <a class="<?=$check ? 'checkRequest' : ''?> placehold" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Recall" : "Recall This")?></a> + <? if (isset($row['link']) && $row['link']): ?> + <a class="<?=$check ? 'checkRequest' : ''?> placehold" <? if (!empty($row['linkLightbox'])): ?>data-lightbox <? endif; ?>href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Recall" : "Recall This")?></a> <? endif; ?> <? endif; ?> - <? /* finc: use && empty row item notes - CK */ ?> - <? if (isset($row['item_notes']) && !empty($row['item_notes'])): ?> - <div class="item-notes"> - <strong><?=$this->transEsc("Item Notes")?>:</strong> - <ul> - <? foreach ($row['item_notes'] as $item_note): ?> - <li><?=$this->escapeHtml($item_note)?></li> - <? endforeach; ?> - </ul> - </div> - <? endif; ?> + <? /* finc: use && empty row item notes - CK */ ?> + <? if (isset($row['item_notes']) && !empty($row['item_notes'])): ?> + <div class="item-notes"> + <strong><?=$this->transEsc("Item Notes")?>:</strong> + <ul> + <? foreach ($row['item_notes'] as $item_note): ?> + <li><?=$this->escapeHtml($item_note)?></li> + <? endforeach; ?> + </ul> + </div> <? endif; ?> + <? endif; ?> <? /* Embed item structured data: library, barcode, call number */ ?> <? if ($row['location']): ?> <meta property="seller" content="<?=$this->escapeHtmlAttr($row['location'])?>"/> @@ -205,9 +185,30 @@ if (!empty($holdingTitleHold)): ?> <link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut"/> <link property="itemOffered" href="#record"/> </td> + + <? /* finc: change separate <tr>-element to <td> with including <span> #13606 - VE */ ?> + <td> + <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); + if (!empty($callNos)): ?> + <span> + <? /* finc: no links back to alphabrows here - CK */ ?> + <? foreach ($callNos as $callNo): ?> + <?=$this->transEsc("Call Number")?>: <?=$this->escapeHtml($callNo)?><br/> + <? endforeach; ?> + </span> + <? endif; ?> + <? if (isset($holding['textfields'])): foreach ($holding['textfields'] as $textFieldName => $textFields): ?> + <span> + <? foreach ($textFields as $current): ?> + <?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>: <?=$this->escapeHtml($current)?><br/> + <? endforeach; ?> + </span> + <? endforeach; endif; ?> + </td> </tr> <? endif; ?> <? endforeach; ?> + <? if (!empty($holding['purchase_history'])): ?> <tr> <th><?=$this->transEsc("Most Recent Received Issues")?>:</th> -- GitLab