diff --git a/module/fid_bbi/src/fid_bbi/Db/Table/Tags.php b/module/fid_bbi/src/fid_bbi/Db/Table/Tags.php index 69a0511e80f576cfc77446ef287269e8ae2cd6d7..d25c455f95215a9dabd997527069c2c207ab6db4 100644 --- a/module/fid_bbi/src/fid_bbi/Db/Table/Tags.php +++ b/module/fid_bbi/src/fid_bbi/Db/Table/Tags.php @@ -88,7 +88,7 @@ class Tags extends BaseTags // contrary to the VuFind core approach we want all // TAGS of RECORDS from 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) { $select->where->equalTo('r.source', $source); diff --git a/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php b/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php index c690ec494a212aa211d5df4f14b2eddc38a0bfb5..0f02f5e9a9e9ec9bc8b8d573489afd98c11f595b 100644 --- a/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/fid_bbi/src/fid_bbi/View/Helper/Root/RecordDataFormatterFactory.php @@ -131,7 +131,7 @@ class RecordDataFormatterFactory $spec->setTemplateLine( 'Related Items', 'getAllRecordLinks', 'data-allRecordLinks.phtml' ); - $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + $spec->setTemplateLine(1, true, 'data-tags.phtml'); return $spec->getArray(); } @@ -364,7 +364,7 @@ class RecordDataFormatterFactory 'useCache' => true ] ); - $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + $spec->setTemplateLine(2, true, 'data-tags.phtml'); return $spec->getArray(); } @@ -528,7 +528,7 @@ class RecordDataFormatterFactory 'getMegaCollection', 'data-escapeHtml.phtml' ); - $spec->setTemplateLine('Tags', true, 'data-tags.phtml'); + $spec->setTemplateLine(3, true, 'data-tags.phtml'); return $spec->getArray(); } diff --git a/themes/fid_bbi/scss/compiled.scss b/themes/fid_bbi/scss/compiled.scss index 1c41a41030d6a416906e422fb2f27b6fc04f1965..3c4fea5ff36bec03680196af4bd628edbaaffbb3 100644 --- a/themes/fid_bbi/scss/compiled.scss +++ b/themes/fid_bbi/scss/compiled.scss @@ -653,4 +653,21 @@ table.tags { .tag-browse-button a { 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 diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml index 9a182819f4b39d1e6b0d239dda7f0cdf62c1f4f2..17cdc4e69a2f08047a6d5f1276f3d95cb979f6fa 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/core.phtml @@ -64,10 +64,14 @@ <table class="table table-striped"> <caption class="sr-only"><?=$this->transEsc('Bibliographic Details')?></caption> <?php foreach ($coreFields as $current): ?> - <tr> - <th><?=$this->transEsc($current['label'])?>:</th> - <td><?=$current['value']?></td> - </tr> + <?php if (is_numeric($current['label'])): ?> + <?=$current['value']?> + <?php else: ?> + <tr> + <th><?=$this->transEsc($current['label'])?>:</th> + <td><?=$current['value']?></td> + </tr> + <?php endif; ?> <?php endforeach; ?> </table> <?php endif; ?> diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml new file mode 100644 index 0000000000000000000000000000000000000000..2aa23e425bb0ed548907dec24f8c6b10da9f79f2 --- /dev/null +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/data-tags.phtml @@ -0,0 +1,28 @@ +<?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; ?> diff --git a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml index efd3d618374595e5b41040bc82f1d93ff3bfb22e..c0ab69367872eaa964c431b4299a77ea07cea179 100644 --- a/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml +++ b/themes/fid_bbi/templates/RecordDriver/DefaultRecord/list-entry.phtml @@ -95,7 +95,7 @@ if ($cover): <?php /*fid_bbi #16050 and #16788*/ $listTags = ($this->usertags()->getMode() !== 'disabled') ? $this->driver->getTags( - null, $user_id, 'tag',$user_id + null, null, 'tag',$user_id ) : array(); ?> @@ -215,7 +215,10 @@ if ($cover): <?php /*fid_bbi #16050*/ if (!empty($listTags)): ?> <strong><?=$this->transEsc('Your Tags')?>:</strong> <?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; ?> <br/> <?php endif; ?>