Skip to content
Snippets Groups Projects
Commit 9b224ff7 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #17354 [fid_bbi] improved display of tags

* on detail view:
** introduce (visually) independent tag section
** remove unnecessary whitespace
* only show own tags in favorite list
parent 04133cd5
Branches
Tags
No related merge requests found
...@@ -88,7 +88,7 @@ class Tags extends BaseTags ...@@ -88,7 +88,7 @@ class Tags extends BaseTags
// contrary to the VuFind core approach we want all // contrary to the VuFind core approach we want all
// TAGS of RECORDS from the list // TAGS of RECORDS from the list
// not only those tagged within the list // not only those tagged within the list
$select->where->equalTo('ur.user_id', $userId); $select->where->equalTo('rt.user_id', $userId);
if (null !== $source) { if (null !== $source) {
$select->where->equalTo('r.source', $source); $select->where->equalTo('r.source', $source);
......
...@@ -131,7 +131,7 @@ class RecordDataFormatterFactory ...@@ -131,7 +131,7 @@ class RecordDataFormatterFactory
$spec->setTemplateLine( $spec->setTemplateLine(
'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml'
); );
$spec->setTemplateLine('Tags', true, 'data-tags.phtml'); $spec->setTemplateLine(1, true, 'data-tags.phtml');
return $spec->getArray(); return $spec->getArray();
} }
...@@ -364,7 +364,7 @@ class RecordDataFormatterFactory ...@@ -364,7 +364,7 @@ class RecordDataFormatterFactory
'useCache' => true 'useCache' => true
] ]
); );
$spec->setTemplateLine('Tags', true, 'data-tags.phtml'); $spec->setTemplateLine(2, true, 'data-tags.phtml');
return $spec->getArray(); return $spec->getArray();
} }
...@@ -528,7 +528,7 @@ class RecordDataFormatterFactory ...@@ -528,7 +528,7 @@ class RecordDataFormatterFactory
'getMegaCollection', 'getMegaCollection',
'data-escapeHtml.phtml' 'data-escapeHtml.phtml'
); );
$spec->setTemplateLine('Tags', true, 'data-tags.phtml'); $spec->setTemplateLine(3, true, 'data-tags.phtml');
return $spec->getArray(); return $spec->getArray();
} }
......
...@@ -653,4 +653,21 @@ table.tags { ...@@ -653,4 +653,21 @@ table.tags {
.tag-browse-button a { .tag-browse-button a {
font-size: larger; font-size: larger;
}
// change hover color for tag badge
.tagList.loggedin .tag:not(.selected) .badge:hover { background-color: $brand-primary-light; }
.tagList .tag {
margin-left: -$padding-base-vertical;
margin-right: $padding-base-vertical;
line-break: unset;
}
tr.hline {
border-top: 1px solid $brand-primary-light;
}
.tag-record.pull-right {
margin-left: 1rem;
} }
\ No newline at end of file
...@@ -64,10 +64,14 @@ ...@@ -64,10 +64,14 @@
<table class="table table-striped"> <table class="table table-striped">
<caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption>
<?php foreach ($coreFields as $current): ?> <?php foreach ($coreFields as $current): ?>
<tr> <?php if (is_numeric($current['label'])): ?>
<th><?=$this->transEsc($current['label'])?>:</th> <?=$current['value']?>
<td><?=$current['value']?></td> <?php else: ?>
</tr> <tr>
<th><?=$this->transEsc($current['label'])?>:</th>
<td><?=$current['value']?></td>
</tr>
<?php endif; ?>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<?php endif; ?> <?php endif; ?>
......
<?php
/*
* this is a copy of themes/bootstrap3/templates/RecordDriver/DefaultRecord/data-tags.phtml
* BBI specific changes are:
* * all wrapped in spanned table row
*
* @author: Dorian Merz <merz@ub.uni-leipzig.de>
*/
?>
<?php
if($loggedin = $this->auth()->isLoggedIn()) {
$user_id = $loggedin->id;
$loggedin = true;
} else {
$user_id = false;
}
?>
<?php if ($this->usertags()->getMode() !== 'disabled'): ?>
<tr class="hline"><!--empty row--><td></td><td></td></tr>
<tr><th><?=$this->translate('Tags')?>:</th><td><!--empty cell--></td></tr>
<tr><td colspan="2">
<?php $tagList = $this->driver->getTags(null, null, 'count', $user_id); ?>
<a class="tag-record btn btn-link pull-right flip" href="<?=$this->recordLink()->getActionUrl($this->driver, 'AddTag')?>" data-lightbox>
<i class="fa fa-plus" aria-hidden="true"></i> <?=$this->transEsc('Add Tag')?>
</a>
<?=$this->context($this)->renderInContext('record/taglist', ['tagList' => $tagList, 'loggedin' => $loggedin]) ?>
</td></tr>
<?php endif; ?>
...@@ -95,7 +95,7 @@ if ($cover): ...@@ -95,7 +95,7 @@ if ($cover):
<?php /*fid_bbi #16050 and #16788*/ <?php /*fid_bbi #16050 and #16788*/
$listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags( $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags(
null, $user_id, 'tag',$user_id null, null, 'tag',$user_id
) : array(); ) : array();
?> ?>
...@@ -215,7 +215,10 @@ if ($cover): ...@@ -215,7 +215,10 @@ if ($cover):
<?php /*fid_bbi #16050*/ if (!empty($listTags)): ?> <?php /*fid_bbi #16050*/ if (!empty($listTags)): ?>
<strong><?=$this->transEsc('Your Tags')?>:</strong> <strong><?=$this->transEsc('Your Tags')?>:</strong>
<?php foreach ($listTags as $tag): ?> <?php foreach ($listTags as $tag): ?>
<a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet('tags', $tag->tag)?>"><?=$this->escapeHtml($tag->tag)?></a> <?php /* filter for own tags, cf. #17354, DM */?>
<?php if ($tag['is_me'] ?? false): ?>
<a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet('tags', $tag->tag)?>"><?=$this->escapeHtml($tag->tag)?></a>
<?php endif;?>
<?php endforeach; ?> <?php endforeach; ?>
<br/> <br/>
<?php endif; ?> <?php endif; ?>
......
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