Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FINNA-2133] Fix myresearch table for sr #3129

Draft
wants to merge 8 commits into
base: dev
Choose a base branch
from
1 change: 1 addition & 0 deletions local/languages/finna/en-gb.ini
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ embedded_content_heading = "Content Cannot be Displayed"
embedded_content_description = "This content is displayed from %%serviceBaseUrl%%. To see the content, switch over to the external site or modify your cookie settings and allow the following categories: %%consentCategories%%."
embedded_content_external_link = "See content on external site"
Empty Book Bag = "Empty basket"
End of List = "End of list"
Ensembles = "Ensembles"
Established = "Established"
event_date_end = "End date"
Expand Down
1 change: 1 addition & 0 deletions local/languages/finna/fi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ embedded_content_heading = "Sisältöä ei voida näyttää"
embedded_content_description = "Tämä sisältö haetaan osoitteesta %%serviceBaseUrl%%. Sen näyttämiseen vaaditaan, että hyväksyt sivuston evästeet. Pääset näkemään sisällön joko siirtymällä ulkoiselle sivustolle tai sallimalla evästeasetuksista seuraavat: %%consentCategories%%."
embedded_content_external_link = "Siirry ulkoiselle sivustolle"
Empty Book Bag = "Tyhjennä"
End of List = "Luettelon loppu"
Ensembles = "Kokoonpanot"
Era = "Aiheen aika"
Established = "Perustettu"
Expand Down
1 change: 1 addition & 0 deletions local/languages/finna/se.ini
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ embedded_content_description = "Dát sisdoallu boahtá čujuhusas %%serviceBaseU
embedded_content_external_link = "Sirdás olgguldas siidduide"
embedded_content_heading = "Sisdoallu ii sáhte čájehuvvot"
Empty Book Bag = "Gurre"
End of List = "Listtu loahppa"
Ensembles = "Čoakkádusat"
Era = "Fáttá áigi"
Established = "Vuođđuduvvon"
Expand Down
1 change: 1 addition & 0 deletions local/languages/finna/sv.ini
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ embedded_content_heading = "Innehåll kan inte visas"
embedded_content_description = "Innehåll visas från %%serviceBaseUrl%%. För att se innehållet, flytta dig till den externa webbplatsen eller kontrollera dina kakinställningar och acceptera följande kategorier: %%consentCategories%%."
embedded_content_external_link = "Se innehållet på den externa webbplatsen"
Empty Book Bag = "Tömma"
End of List = "Slutet av listan"
Ensembles = "Ensembler"
Established = "Grundad"
event_date_end = "Slutdatum"
Expand Down
9 changes: 7 additions & 2 deletions themes/finna2/js/finna-mylist.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ finna.myList = (function finnaMyList() {
});
}

$('.add-new-list .icon').on('click', function createNewList() {
$('#add-new-list-item-btn').on('click', function createNewList() {
var newListInput = $('.new-list-input');
var newListName = newListInput.val().trim();

Expand All @@ -357,11 +357,16 @@ finna.myList = (function finnaMyList() {
updateList({'id': 'NEW', 'title': newListName, 'desc': null, 'public': 0}, newListAdded, 'add-list');
}
});
$('#add-new-list-item-btn').on('keyup', function invokeCreateNewList(e) {
if (e.keyCode === 32) {
$('#add-new-list-item-btn').trigger("click");
}
});

//Add new list, listen for keyup enter
$('.new-list-input').on('keyup', function invokeCreateNewList(e) {
if (e.keyCode === 13) {
$('.add-new-list .icon').trigger("click");
$('#add-new-list-item-btn').trigger("click");
}
});

Expand Down
8 changes: 7 additions & 1 deletion themes/finna2/scss/finna/mylist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
.add-new-list-holder {
padding: 0 20px;
margin: 5px 0 10px 0px;
#add-new-list-item-btn {
border: none;
&:not(:hover){
background: none;
}
}
.add-new-list {
border: 1px solid $gray-lighter;
display: -webkit-flex;
Expand All @@ -138,7 +144,7 @@
}
}
.list-add-icon {
text-align: right;
text-align: center;
width: 20px;
cursor: pointer;
color: $action-link-color;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
$title = $driver->getTitle();
$title = empty($title) ? $this->transEsc('Title not available') : $this->escapeHtml($title);
}
echo '<a href="' . $this->escapeHtmlAttr($this->recordLinker()->getUrl($driver))
. '" class="record-title">' . $title . '</a>';
echo '<h3 class="record-title"><a href="' . $this->escapeHtmlAttr($this->recordLinker()->getUrl($driver)) . '">' . $title . '</a></h3>';
} elseif (isset($ilsDetails['title']) && !empty($ilsDetails['title'])) {
// If the record is not available in Solr, perhaps the ILS driver sent us a title we can show...
echo '<span class="record-title">' . $this->escapeHtml($ilsDetails['title']) . '</span>';
echo '<h3 class="record-title" tabindex="0">' . $this->escapeHtml($ilsDetails['title']) . '</h3>';
} else {
// Last resort -- indicate that no title could be found.
echo '<span class="record-title">' . $this->transEsc('Title not available') . '</span>';
echo '<h3 class="record-title" tabindex="0">' . $this->transEsc('Title not available') . '</h3>';
}
?>
<div class="record-core-metadata">
Expand Down
4 changes: 3 additions & 1 deletion themes/finna2/templates/checkouts/history.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('Loan History'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Loan History') . '</li>';
Expand All @@ -25,7 +26,7 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Loan History')?> (<?=$recordCount;?>)</h2>
</div>
<?php if (isset($this->noSupport)): ?>
Expand Down Expand Up @@ -183,6 +184,7 @@
</tr>
<?php endforeach; ?>
</table>
<h3 class="sr-only"><?=$this->transEsc('End of List')?></h3>
<div class="loan-history-buttons-bottom">
<?php if ($purgeAllAllowed): ?>
<div class="dropdown loan-history-purge-all">
Expand Down
4 changes: 3 additions & 1 deletion themes/finna2/templates/holds/list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('My Holds'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';
// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('My Holds') . '</li>';
$user = $this->auth()->getUserObject();
Expand All @@ -20,7 +21,7 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Your Holds and Recalls') ?> (<?=count($this->recordList ?? []);?>)</h2>
</div>
<?php if (isset($this->noSupport)): ?>
Expand Down Expand Up @@ -242,6 +243,7 @@
</tr>
<?php endforeach; ?>
</table>
<h3 class="sr-only"><?=$this->transEsc('End of List')?></h3>
<?php if ($this->cancelForm): ?>
<div class="dropdown button-bottom">
<input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr('hold_cancel_all') ?>" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" data-lightbox-ignore>
Expand Down
4 changes: 3 additions & 1 deletion themes/finna2/templates/layout/layout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@
<?php endif; ?>
<?php
$contentElementId = 'main';
if (!empty($this->layout()->finnaMainHeader)) {
if (!empty($this->layout()->finnaUseraccountHeader)) {
$contentElementId = 'useraccount-content-header';
} elseif (!empty($this->layout()->finnaMainHeader)) {
$contentElementId = 'content-heading';
} elseif (!empty($this->layout()->finnaMainTabs)) {
$contentElementId = 'content-main-tabs';
Expand Down
5 changes: 3 additions & 2 deletions themes/finna2/templates/librarycards/home.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('Library Cards'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Library Cards') . '</li>';
Expand All @@ -19,13 +20,13 @@
<div class="my-research-content">
<?=$this->flashmessages()?>
<?php if (!$this->translationEmpty('library_cards_instructions_html')): ?><p class="no-content-message"><?=$this->translate('library_cards_instructions_html')?></p><?php endif; ?>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Library Cards Connected To My Account')?></h2>
</div>
<?php if (empty($this->libraryCards)): ?>
<h4><?=$this->transEsc('You do not have any library cards')?></h4>
<?php else: ?>
<table class="table table-striped useraccount-table library-cards mobile-table">
<table class="table table-striped useraccount-table library-cards mobile-table" tabindex="0">
<tr class="headers">
<th class="card-name"><?=$this->transEsc('Library Card Name')?></th>
<?php if ($this->multipleTargets): ?>
Expand Down
4 changes: 3 additions & 1 deletion themes/finna2/templates/myresearch/checkedout.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('Checked Out Items'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Checked Out Items') . '</li>';
Expand All @@ -27,7 +28,7 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Your Checked Out Items')?> (<?=$totalCount?>)</h2>
</div>
<?php if (isset($this->noSupport)): ?>
Expand Down Expand Up @@ -249,6 +250,7 @@
</tr>
<?php endforeach; ?>
</table>
<h3 class="sr-only"><?=$this->transEsc('End of List')?></h3>
</form>
<?php if ($template = $this->content()->findTemplateForLng('content/Additions/checkedout-post-list')): ?>
<div class="checkedout-post-list"><?=$this->render($template)?></div>
Expand Down
7 changes: 4 additions & 3 deletions themes/finna2/templates/myresearch/fines.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('My Fines'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Fines') . '</li>';
Expand Down Expand Up @@ -116,13 +117,13 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Your Fines') . ' (' . count($this->fines ?? []) . ')'?></h2>
</div>
</div>
<?=$this->flashmessages()?>
<?=$this->partial('myresearch/borrowing-block.phtml', ['blocks' => $this->blocks]); ?>
<div class="fines-info-area">
<div class="fines-info-area" tabindex="0">
<?php if (!empty($this->lastTransaction)): ?>
<div class="last-transaction-information">
<div>
Expand Down Expand Up @@ -234,7 +235,7 @@
</div>
</div>
<?php endif; ?>
<table class="table finna-table-striped useraccount-table<?=$this->onlinePayment ? ' online-payment' : ''?> table-responsive fines-table">
<table class="table finna-table-striped useraccount-table<?=$this->onlinePayment ? ' online-payment' : ''?> table-responsive fines-table" tabindex="0">
<caption class="sr-only"><?=$this->transEsc('Your Fines')?></caption>
<thead>
<tr class="headers">
Expand Down
4 changes: 3 additions & 1 deletion themes/finna2/templates/myresearch/illrequests.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('Interlibrary Loan Requests'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li>'
Expand All @@ -21,7 +22,7 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Interlibrary Loan Requests') ?> (<?=count($this->recordList ?? []);?>)</h2>
</div>
<?php if (isset($this->noSupport)): ?>
Expand Down Expand Up @@ -181,6 +182,7 @@
</tr>
<?php endforeach; ?>
</table>
<h3 class="sr-only"><?=$this->transEsc('End of List')?></h3>
<?php if ($this->cancelForm): ?>
<div class="dropdown button-bottom">
<input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr('ill_request_cancel_all') ?>" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
Expand Down
4 changes: 2 additions & 2 deletions themes/finna2/templates/myresearch/menu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
?>
<?php if ($hasPartial): ?>
<li role="none" class="dropdown <?= $listItem['active'] ? ' active' : ''?>">
<a role="menuitem" href="<?=$this->escapeHtmlAttr($this->url($listItem['url']) . ($listItem['query'] ?? ''))?>" id="<?=$id?>" class="menu-parent sticky-menu hidden-xs hidden-sm list-group-item <?= !$listItem['active'] ? 'collapsed' : '' ?>" aria-haspopup="true" aria-expanded="<?=$listItem['active'] ? 'true' : 'false'?>">
<a href="<?=$this->escapeHtmlAttr($this->url($listItem['url']) . ($listItem['query'] ?? ''))?>" id="<?=$id?>" class="menu-parent sticky-menu hidden-xs hidden-sm list-group-item <?= !$listItem['active'] ? 'collapsed' : '' ?>" aria-haspopup="true" aria-expanded="<?=$listItem['active'] ? 'true' : 'false'?>">
<?=$this->transEsc($listItem['translation'])?>
<?php if ($showSpinner) : ?>
<?=$this->icon('spinner', ['class' => 'hidden']) ?><span class="ajax-error hidden"><small> <?=$this->translate('An error has occurred'); ?></small></span>
Expand All @@ -182,7 +182,7 @@
</li>
<?php else: ?>
<li role="none" class="hidden-xs hidden-sm <?="menu-$name"?> <?=$activeToLower === $name ? ' active' : ''?>">
<a role="menuitem" href="<?=$this->escapeHtmlAttr($this->url($listItem['url']) . ($listItem['query'] ?? ''))?>" class="list-group-item" <?=$activeToLower === $name ? 'aria-current="page"' : ''?>>
<a href="<?=$this->escapeHtmlAttr($this->url($listItem['url']) . ($listItem['query'] ?? ''))?>" class="list-group-item" <?=$activeToLower === $name ? 'aria-current="page"' : ''?>>
<?=$this->transEsc($listItem['translation'])?>
<?php if (isset($listItem['iconClass'])): ?>
<?=$listItem['iconClass']?>
Expand Down
2 changes: 1 addition & 1 deletion themes/finna2/templates/myresearch/mylist-navi.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<li class="add-new-list-holder favorites-menulist-item">
<div class="list-group-item add-new-list">
<input type="text" class="new-list-input" placeholder="<?=$this->transEsc('Create a List') ?>">
<?=$this->icon('list-add', 'list-add-icon') ?>
<button id="add-new-list-item-btn" aria-label="<?=$this->transEsc('Create a List') ?>"><?=$this->icon('list-add', 'list-add-icon') ?></button>
</div>
</li>
</ul>
Expand Down
3 changes: 2 additions & 1 deletion themes/finna2/templates/myresearch/mylist.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// Set up page title:
$this->headTitle($list ? $list->getTitle() : $this->translate('saved_items'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$currPage = $list ? 'List' : 'saved_items';
Expand Down Expand Up @@ -43,7 +44,7 @@
<input type="hidden" name="listID" value="<?=$this->escapeHtmlAttr($list->getId())?>">
<input type="hidden" name="listName" value="<?=$this->escapeHtmlAttr($list->getTitle())?>">
<?php endif; ?>
<div class="clearfix mylist-header hidden-print">
<div id="useraccount-content-header" class="clearfix mylist-header hidden-print" tabindex="0">
<div>
<?=$this->flashmessages()?>
</div>
Expand Down
3 changes: 2 additions & 1 deletion themes/finna2/templates/myresearch/profile.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('My Profile'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';
// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Profile') . '</li>';
// Only display home library form if we have multiple pickup locations:
Expand Down Expand Up @@ -44,7 +45,7 @@
<?= $this->context($this)->renderInContext('myresearch/menu.phtml', ['active' => 'profile']); ?>

<div class="<?=$this->layoutClass('mainbody-myresearch')?>">
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Profile')?></h2>
</div>
<div class="my-research-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set up page title:
$this->headTitle($this->translate('Storage Retrieval Requests'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

// Set up breadcrumbs:
$this->layout()->breadcrumbs = '<li><a href="' . $this->url('myresearch-home') . '">' . $this->transEsc('Your Account') . '</a></li> <li class="active">' . $this->transEsc('Storage Retrieval Requests') . '</li>';
Expand All @@ -20,7 +21,7 @@
<div class="useraccount-row">
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', ['user' => $user, 'label' => 'Library Card'])?>
</div>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('Storage Retrieval Requests') ?> (<?=count($this->recordList ?? []);?>)</h2>
</div>
<?php if (isset($this->noSupport)): ?>
Expand Down Expand Up @@ -177,6 +178,7 @@
</tr>
<?php endforeach; ?>
</table>
<h3 class="sr-only"><?=$this->transEsc('End of List')?></h3>
<?php if ($this->cancelForm): ?>
<div class="dropdown button-bottom">
<input id="cancelAll" name="cancelAll" type="submit" value="<?=$this->transEscAttr('storage_retrieval_request_cancel_all') ?>" class="btn btn-danger dropdown-toggle" data-toggle="dropdown">
Expand Down
2 changes: 1 addition & 1 deletion themes/finna2/templates/search/history-table.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
}
?>
<table class="search-history-table" id="<?=$this->showSaved ? 'saved-searches' : 'recent-searches'?>">
<table class="search-history-table" id="<?=$this->showSaved ? 'saved-searches' : 'recent-searches'?>" tabindex="0">
<thead>
<tr>
<th scope="col" class="history_time"><?=$this->transEsc('history_time')?></th>
Expand Down
5 changes: 3 additions & 2 deletions themes/finna2/templates/search/history.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php
// Set page title.
$this->headTitle($this->translate('Search History'));
$this->layout()->finnaUseraccountHeader = 'useraccount-content-header';

$saveSupported = $this->accountCapabilities()->getSavedSearchSetting() === 'enabled';
$loggedInUser = $this->auth()->getUserObject();
Expand Down Expand Up @@ -47,7 +48,7 @@
<?php endif; ?>
<?=$this->flashmessages();?>
<?php if ($saveSupported): ?>
<div class="useraccount-header">
<div id="useraccount-content-header" class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('history_saved_searches')?></h2>
</div>
<?php if (!empty($this->saved)): ?>
Expand All @@ -61,7 +62,7 @@
<?php endif; ?>
<?php endif; ?>

<div class="useraccount-header">
<div class="useraccount-header" tabindex="0">
<h2><?=$this->transEsc('history_recent_searches')?></h2>
</div>
<?php if (!empty($this->unsaved)): ?>
Expand Down