update GameView with NodeView as a SideView

This commit is contained in:
axolotle
2021-07-08 17:38:35 +02:00
parent 267551f485
commit 0f2ba3716b
3 changed files with 35 additions and 23 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ fragment NodeInitial on MapItemInterface {
} }
} }
siblings: rebonds { creation_siblings: rebonds {
id id
} }
+33 -22
View File
@@ -1,6 +1,6 @@
<template> <template>
<div class="gallery-view wh-100"> <div class="gallery-view wh-100">
<div v-if="!loading" class="gallery-view-wrapper wh-100"> <div class="gallery-view-wrapper wh-100">
<figure class="gallery-view-figure"> <figure class="gallery-view-figure">
<div class="h-100" /> <div class="h-100" />
@@ -14,23 +14,19 @@
{{ $t('text.open-origin') }} {{ $t('text.open-origin') }}
</b-button> </b-button>
<b-button variant="creation" class="btn-shadow btn-artwork" @click="$emit('view-text')"> <b-button variant="creation" class="btn-shadow btn-artwork" v-b-toggle.gallery-text>
{{ $t('text.open-artwork') }} {{ $t('text.open-artwork') }}
</b-button> </b-button>
</div> </div>
</div> </div>
<figcaption class="gallery-view-caption"> <figcaption class="gallery-view-caption">
<p class="mb-0 mt-4"> <node-view-title :node="node" tag="p" class="mb-0 mt-4" />
<strong>{{ toCommaList(node.authors) }}</strong>,
<em v-html="' ' + trim(node.title)" />,
{{ node.date.start }}
</p>
</figcaption> </figcaption>
</figure> </figure>
<div <div
v-for="(sibling, i) in node.siblings" :key="sibling.id" v-for="(sibling, i) in node.creation_siblings" :key="sibling.id"
class="gallery-view-btn-wrapper" class="gallery-view-btn-wrapper"
:class="buttonClasses[i]" :class="buttonClasses[i]"
> >
@@ -42,25 +38,32 @@
/> />
</button-image> </button-image>
</div> </div>
</div>
<b-overlay <side-view id="gallery-text" right no-cross>
:show="loading" <template #default="{ hide }">
spinner-variant="creation" <node-view
no-wrap :node="node"
/> @close-node="hide"
force-type="ref" show-origin
/>
</template>
</side-view>
</div>
</div> </div>
</template> </template>
<script> <script>
import { NodeViewTitle } from '@/components/nodes' import { NodeViewTitle, NodeView } from '@/components/nodes'
import { SideView } from '@/components/layouts'
import { trim, toCommaList, shuffle } from '@/helpers/common' import { trim, toCommaList, shuffle } from '@/helpers/common'
export default { export default {
name: 'GalleryView', name: 'GalleryView',
components: { components: {
NodeViewTitle NodeViewTitle,
NodeView,
SideView
}, },
props: { props: {
@@ -79,12 +82,6 @@ export default {
} }
}, },
computed: {
loading () {
return this.node === undefined || this.node.dataLevel < 1
}
},
methods: { methods: {
trim, trim,
toCommaList toCommaList
@@ -188,4 +185,18 @@ export default {
} }
} }
} }
::v-deep #gallery-text {
@include media-breakpoint-up($size-bp) {
width: 100%;
}
.node-view {
height: 100%;
&-wrapper {
height: 100%;
}
}
}
</style> </style>
+1
View File
@@ -4,6 +4,7 @@ import { hierarchy } from 'd3-hierarchy'
export const RELATIONS = [ export const RELATIONS = [
'parents', 'parents',
'siblings', 'siblings',
'creation_siblings',
'children' 'children'
] ]