|
|
@@ -8,12 +8,15 @@
|
|
8
|
8
|
h1 {{ type }}:{{ $route.params.slug }} {{ post.title }}
|
|
9
|
9
|
p(v-if="post.categories") categories: {{ post.categories }}
|
|
10
|
10
|
p(v-if="post.type") type: {{ post.type }}
|
|
|
11
|
+
|
|
11
|
12
|
.date-info(v-if="type === 'events' || post.type === 'exhibitions'")
|
|
12
|
13
|
p start: {{ dateFrom(post.start) }}
|
|
13
|
14
|
p end: {{ dateFrom(post.end) }}
|
|
14
|
15
|
|
|
15
|
16
|
block.post-single.block-wrapper(v-for="(block, index) in post.blocks" :block="block" :key="`block-${index}`")
|
|
16
|
17
|
|
|
|
18
|
+ credits(v-if="type === 'episodes'" :post="post")
|
|
|
19
|
+
|
|
17
|
20
|
sidebar(v-if="sidebar" :type="`${type}`")
|
|
18
|
21
|
.shadow
|
|
19
|
22
|
h1.t-up single slot
|
|
|
@@ -25,13 +28,14 @@
|
|
25
|
28
|
import sidebar from '@/components/sidebars/sidebar'
|
|
26
|
29
|
import gallery from '@/components/gallery/'
|
|
27
|
30
|
import block from '@/components/content-block/block'
|
|
|
31
|
+import credits from '@/components/credits'
|
|
28
|
32
|
|
|
29
|
33
|
import { postTypeGetters } from './mixin-post-types'
|
|
30
|
34
|
|
|
31
|
35
|
import { convertTitleCase, dePluralize, typeFromRoute } from '@/utils/helpers'
|
|
32
|
36
|
|
|
33
|
37
|
export default {
|
|
34
|
|
- components: { sidebar, gallery, block },
|
|
|
38
|
+ components: { sidebar, gallery, block, credits },
|
|
35
|
39
|
props: {
|
|
36
|
40
|
sidebar: { type: Boolean },
|
|
37
|
41
|
id: { type: Number }
|
|
|
@@ -53,12 +57,12 @@ export default {
|
|
53
|
57
|
*/
|
|
54
|
58
|
post() {
|
|
55
|
59
|
if(!this[this.type]) return
|
|
56
|
|
-
|
|
|
60
|
+
|
|
57
|
61
|
const type = dePluralize(this.type)
|
|
58
|
62
|
|
|
59
|
63
|
// State not a getter!
|
|
60
|
64
|
const singleOfTypeFromState = this[this.type][`single${convertTitleCase(type)}`]
|
|
61
|
|
-
|
|
|
65
|
+
|
|
62
|
66
|
if(!singleOfTypeFromState) return
|
|
63
|
67
|
|
|
64
|
68
|
return singleOfTypeFromState
|
|
|
@@ -139,7 +143,7 @@ export default {
|
|
139
|
143
|
*/
|
|
140
|
144
|
let type = convertTitleCase(this.type)
|
|
141
|
145
|
let allPostsOfType = this.$store.state[this.type].all
|
|
142
|
|
-
|
|
|
146
|
+
|
|
143
|
147
|
/**
|
|
144
|
148
|
* Load posts if they're not already in state
|
|
145
|
149
|
*/
|
|
|
@@ -149,7 +153,7 @@ export default {
|
|
149
|
153
|
console.log(`reloaded ${type}...`)
|
|
150
|
154
|
}
|
|
151
|
155
|
const singlePostData = Object.values(allPostsOfType).filter(post => post.slug == this.$route.params.slug)[0]
|
|
152
|
|
-
|
|
|
156
|
+
|
|
153
|
157
|
await this.$store.dispatch(`getSingle${dePluralize(type)}`, singlePostData.id)
|
|
154
|
158
|
}
|
|
155
|
159
|
}
|