Skip to content
Snippets Groups Projects
Commit bf709368 authored by Aspectis's avatar Aspectis Committed by Dorian Merz
Browse files

refs #19013 [fid_bbi] improve databases template

* Add title and proper heading levels
* Add loading animation
* Improve list styles
parent 0dd19abb
No related merge requests found
.dbis {
//
}
.dbis_icon {
flex: 0 0 g();
margin-right: g(.25);
}
.dbis_list {
list-style: none;
padding-left: 0;
li {
display: flex;
&::before {
content: none;
}
}
}
.narrow {
margin: 0 auto;
max-width: $line-width;
}
......@@ -29,6 +29,7 @@
@import 'blocks/browse';
@import 'blocks/button';
@import 'blocks/container';
@import 'blocks/dbis';
@import 'blocks/facet';
@import 'blocks/filters';
@import 'blocks/footer';
......@@ -40,6 +41,7 @@
@import 'blocks/link-with-icon';
@import 'blocks/main';
@import 'blocks/modal';
@import 'blocks/narrow';
@import 'blocks/nav';
@import 'blocks/pagination';
@import 'blocks/posts';
......
<!-- fid_bbi: finc - dbis - result -->
<?php
/**
* Copied from themes/finc-dbis/templates/finc/dbis/result.phtml
* Changes for FID BBI:
* - Add classes and elements required for styling
* - Use external link view helper
*
* @author Tobias Schäfer <ts@aspectis.net>
*/
?>
<div class="dbis openurls">
<div class="alert alert-info">
<?=$this->icon('small/info')?>
<h3><?=$this->transEsc('Dbis Access Legend')?></h3>
<ul class="unstyled-list">
<?php /** @var finc\Dbis\Model\Api\DbAccessInfo $accessInfo */ ?>
<?php foreach ($this->result->getDbAccessInfos()->getDbAccessInfo() as $accessInfo): ?>
<li>
<img
title="<?=$this->translate('dbis_' . $accessInfo->getAccessId())?>"
src="<?=$this->imageLink('dbis-list-' . $accessInfo->getAccessId() . '.png')?>"
alt="<?=$accessInfo->getDbAccessShortText()?>"
>
<?=$accessInfo->getDbAccess()?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php /** @var finc\Dbis\Model\View\Group $group */ ?>
<?php foreach ($this->result as $group): ?>
<h3><?=$this->translate('Dbis ' . $group->getName())?></h3>
<ul class="dbis_list">
<?php foreach ($group as $item): ?>
<li>
<span
<?php if (!empty($item->getAccessText())): ?>
data-toggle="tooltip"
data-html="true"
title="<?=$item->getAccessText()?>"
<?php endif; ?>
class="dbis_icon dbis-list-accessinfo-<?=$item->getDb()->getAccessRef()?>"
>
<img src="<?=$this->imageLink('dbis-list-' . $item->getDb()->getAccessRef() . '.png')?>" alt="">
</span>
<span>
<?=$this->externalLink($item->getUrl(), $item->getName())?>
</span>
</li>
<?php endforeach; ?>
</ul>
<?php endforeach; ?>
</div>
<!-- dbis-module: ajax - dbis - END -->
<!-- fid_bbi: myresearch - databases -->
<?php
/**
* Copied from themes/fid/templates/myresearch/databases.phtml
* Changes for FID BBI:
* - Add head title
* - Use proper headings
* - Use external link view helper
*
* @author Tobias Schäfer <ts@aspectis.net>
*/
?>
<?php
$this->headTitle($this->translate('dbis_licenses_name'));
$account = $this->auth()->getManager();
?>
<div class="narrow">
<h1><?=$this->translate('dbis_licenses_name')?></h1>
<?php if (!$account->isLoggedIn()): ?>
<p><?=$this->translate('licenses_forbidden_login_required')?></p>
<?php elseif (!$this->permission()->allowDisplay('access.Licenses')) : ?>
<p><?=$this->translate('licenses_forbidden_permission_denied')?></p>
<?php elseif (empty($licenses)) : ?>
<p><?=$this->translate('licenses_not_available')?></p>
<?php else: ?>
<p><?=$this->translate('licenses_text')?></p>
<p class="dbis_description">
<?=$this->translate('licenses_notice_html',
[
'%%contact_url%%' => $this->url('feedback-home'),
'%%terms_url%%' => $this->url('fid/user/terms')
]
)?>
</p>
<p><?=$this->transEsc('licenses_desc_1')?></p>
<ul class="licenses">
<?php foreach ($licenses as $license): ?>
<li>
<?=$this->externalLink($license['url'], $this->translate('licenses_' . $license['name']))?>
(<?=$license['desc']?>)
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($this->isDbisAvailable) : ?>
<?=$this->render('myresearch/dbis-content')?>
<?php endif; ?>
</div>
<!-- fid_bbi: myresearch - databases - END -->
<!-- fid_bbi: myresearch - dbis-content -->
<?php
/**
* Copied from themes/fid/templates/myresearch/dbis-content.phtml
* Changes for FID BBI:
* - Hide obsolete heading
* - Add loading animation
*
* @author Tobias Schäfer <ts@aspectis.net>
*/
?>
<h2 class="sr-only"><?=$this->translate('dbis_name')?></h2>
<p><?=$this->translate('dbis_text')?></p>
<div class="dbis_content" id="dbis_content" style="min-height: 140px; position: relative">
<div class="modal-loading">
<span class="sr-only"><?=$this->translate('Loading')?></span>
</div>
</div>
<?php
$dbisId = $this->homeLibrary ?? '';
$dbisRequest = "$(document).ready(function () {
$.ajax({
dataType: 'json',
method: 'GET',
url: VuFind.path + '/AJAX/JSON?method=getDbis&bibId=$dbisId&map_bibid_to_dbis=$this->map_bibid_to_dbis'
})
.done(function(response) {
$('#dbis_content').html(response.data.html);
});
});";
echo $this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $dbisRequest, 'SET');
?>
<!-- fid_bbi: myresearch - dbis-content - END -->
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment