|
|
@@ -13,7 +13,8 @@
|
|
13
|
13
|
|
|
14
|
14
|
.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
|
|
15
|
15
|
section(v-for="(post, i) in posts" :key="post.slug").shadow.post
|
|
16
|
|
- card(:content="post" :type="type" :wide="type == 'exhibitions' && i > 1 || type == 'events' && i > 1 ")
|
|
|
16
|
+ p {{ post }}
|
|
|
17
|
+ //- card(:content="post" :type="type" :wide="type == 'exhibitions' && i > 1 || type == 'events' && i > 1 ")
|
|
17
|
18
|
|
|
18
|
19
|
footer
|
|
19
|
20
|
p {{ `${type} count: ${Object.values(posts).length}` }}
|
|
|
@@ -69,20 +70,26 @@ export default {
|
|
69
|
70
|
* so if a sortBy is specified we return it sorted or
|
|
70
|
71
|
* we fail over to sorted by date
|
|
71
|
72
|
*/
|
|
72
|
|
- return this.sortBy ? this[`all${type}`] : sortedByRecent
|
|
|
73
|
+ let returnList = sortedByRecent
|
|
|
74
|
+ if(this.sortBy && sortTypes.includes(this.sortBy)) {
|
|
|
75
|
+ returnList = this[`all${type}`]
|
|
|
76
|
+ }
|
|
|
77
|
+ if(['exhibitions', 'events'].includes(this.type)) {
|
|
|
78
|
+ returnList = this[`all${type}`]
|
|
|
79
|
+ }
|
|
|
80
|
+ return returnList
|
|
73
|
81
|
},
|
|
74
|
82
|
},
|
|
75
|
83
|
methods: {
|
|
76
|
84
|
getPosts() {
|
|
77
|
85
|
// Sorting
|
|
78
|
86
|
let sort = this.sortBy ? this.sortBy : this.$route.path.split('/').pop()
|
|
|
87
|
+ // !: BUG
|
|
|
88
|
+ // if(this.type !== sort || !Object.values(sortTypes).includes(sort)) sort = null
|
|
79
|
89
|
if(Object.values(sortTypes).includes(sort)) {
|
|
80
|
90
|
console.log('trying to sort by:', sort)
|
|
81
|
91
|
console.log(`sortTypes includes ${sort}:`, Object.values(sortTypes).includes(sort))
|
|
82
|
92
|
}
|
|
83
|
|
- // Is this a sort type?
|
|
84
|
|
- // !: BUG
|
|
85
|
|
- // if(this.type !== sort || !Object.values(sortTypes).includes(sort)) sort = null
|
|
86
|
93
|
|
|
87
|
94
|
// Don't dispatch if there's no type
|
|
88
|
95
|
if(this.type && this.dispatchName) {
|