|
@@ -3,38 +3,34 @@
|
|
|
class="node-view-footer" :class="'node-view-footer-' + mode"
|
|
|
>
|
|
|
<div class="d-flex w-100">
|
|
|
- <div class="tags">
|
|
|
+ <div class="tags mb-n2">
|
|
|
<b-badge
|
|
|
v-for="tag in node.tags" :key="tag.id"
|
|
|
- variant="dark" pill
|
|
|
+ variant="dark" pill class="mr-2 mb-2"
|
|
|
>
|
|
|
{{ tag.name }}
|
|
|
</b-badge>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="mode === 'view' && node.siblings">
|
|
|
+ <div v-if="mode === 'view' && node.siblings && node.siblings.length">
|
|
|
<b-button :id="'siblings-' + node.id">
|
|
|
{{ $t('siblings') }}
|
|
|
</b-button>
|
|
|
|
|
|
<b-popover
|
|
|
- :target="'siblings-' + node.id" triggers="hover" placement="top"
|
|
|
+ :target="'siblings-' + node.id" triggers="click" placement="top"
|
|
|
+ custom-class="popover-siblings"
|
|
|
+ boundary="viewport"
|
|
|
>
|
|
|
- <div v-for="sibling in node.siblings" :key="sibling.id">
|
|
|
- <h6>
|
|
|
- <a @click.prevent="onOpen(sibling.id)" href="#">
|
|
|
- <div class="">
|
|
|
- {{ toCommaList(sibling.authors) }},
|
|
|
- </div>
|
|
|
- <div class="">
|
|
|
- {{ sibling.title }},
|
|
|
- </div>
|
|
|
- <div class="">
|
|
|
- {{ sibling.edition ? sibling.edition.name : sibling.edition }}
|
|
|
- </div>
|
|
|
- </a>
|
|
|
- </h6>
|
|
|
- </div>
|
|
|
+ <ul>
|
|
|
+ <li v-for="sibling in node.siblings" :key="sibling.id">
|
|
|
+ <node-view-title
|
|
|
+ :node="sibling"
|
|
|
+ link edition block
|
|
|
+ @open-node="onOpen(sibling.id, 'siblings-' + node.id)"
|
|
|
+ />
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</b-popover>
|
|
|
</div>
|
|
|
|
|
@@ -49,11 +45,16 @@
|
|
|
|
|
|
<script>
|
|
|
import { toCommaList } from '@/helpers/common'
|
|
|
+import { NodeViewTitle } from '@/components/nodes'
|
|
|
|
|
|
|
|
|
export default {
|
|
|
name: 'NodeViewFooter',
|
|
|
|
|
|
+ components: {
|
|
|
+ NodeViewTitle
|
|
|
+ },
|
|
|
+
|
|
|
props: {
|
|
|
node: { type: Object, required: true },
|
|
|
type: { type: String, required: true },
|
|
@@ -71,16 +72,40 @@ export default {
|
|
|
methods: {
|
|
|
toCommaList,
|
|
|
|
|
|
- onOpen (parentId) {
|
|
|
+ onOpen (parentId, popoverBtnId) {
|
|
|
+ this.$root.$emit('bv::hide::popover', popoverBtnId)
|
|
|
this.$parent.$emit('open-node', { parentId })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped>
|
|
|
+<style lang="scss">
|
|
|
.node-view-footer {
|
|
|
margin-top: auto;
|
|
|
font-family: $font-family-base;
|
|
|
}
|
|
|
+
|
|
|
+.popover-siblings {
|
|
|
+ background-color: $white;
|
|
|
+ border: $line;
|
|
|
+
|
|
|
+ .popover-body {
|
|
|
+ color: $black;
|
|
|
+
|
|
|
+ ul {
|
|
|
+ list-style: none;
|
|
|
+ padding: 0;
|
|
|
+ margin: 0;
|
|
|
+
|
|
|
+ li:not(:last-of-type) {
|
|
|
+ margin-bottom: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ h6 {
|
|
|
+ margin: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|