|
|
@@ -1,11 +1,14 @@
|
|
1
|
1
|
<template lang="pug">
|
|
2
|
2
|
.page--list.f-row.between
|
|
3
|
3
|
article.f-grow
|
|
4
|
|
- header.f-row.center.t-up
|
|
5
|
|
- h1 {{ type }} list
|
|
|
4
|
+ header.f-col.center.t-up
|
|
|
5
|
+ .title.f-row
|
|
|
6
|
+ h1 {{ type }} list
|
|
|
7
|
+ span(v-if="sortBy")
|
|
|
8
|
+ h1 sorted by {{ sortBy.replace('-', ' ') }}
|
|
|
9
|
+
|
|
6
|
10
|
h3(v-if="!loaded") loading...
|
|
7
|
|
- span(v-if="sortBy")
|
|
8
|
|
- h1 sorted by {{ sortBy.replace('-', ' ') }}
|
|
|
11
|
+ .content(v-else-if="allPagesLoaded && type && allPages[type]" v-html="allPages[type].content")
|
|
9
|
12
|
|
|
10
|
13
|
.posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
|
|
11
|
14
|
section(v-for="post in posts" :key="post.slug").shadow.post
|
|
|
@@ -104,16 +107,18 @@ export default {
|
|
104
|
107
|
},
|
|
105
|
108
|
watch: {
|
|
106
|
109
|
$route(to, from){
|
|
107
|
|
- console.log(this.sidebar)
|
|
|
110
|
+ // console.log(this.sidebar)
|
|
108
|
111
|
let type = convertTitleCase(this.type)
|
|
109
|
112
|
let sort = this.sortBy ? this.sortBy : to.path.split('/').pop()
|
|
110
|
113
|
|
|
|
114
|
+ this.$store.dispatch('getAllPages')
|
|
111
|
115
|
if(!this[`all${type}Loaded`] || sort) this.setHeroAndGetPosts()
|
|
112
|
116
|
}
|
|
113
|
117
|
},
|
|
114
|
118
|
created() {
|
|
115
|
119
|
let type = convertTitleCase(this.type)
|
|
116
|
120
|
// console.log('already loaded ?:', this[`all${type}Loaded`])
|
|
|
121
|
+ this.$store.dispatch('getAllPages')
|
|
117
|
122
|
if(!this[`all${type}Loaded`]) this.setHeroAndGetPosts()
|
|
118
|
123
|
}
|
|
119
|
124
|
}
|
|
|
@@ -122,6 +127,13 @@ export default {
|
|
122
|
127
|
<style lang="postcss">
|
|
123
|
128
|
.page--list
|
|
124
|
129
|
article
|
|
|
130
|
+ > header
|
|
|
131
|
+ padding: 1em 0 1em 0
|
|
|
132
|
+ > h1
|
|
|
133
|
+ margin: 0
|
|
|
134
|
+ > .content
|
|
|
135
|
+ padding: 0
|
|
|
136
|
+ width: 100%
|
|
125
|
137
|
/* posts not grid list */
|
|
126
|
138
|
ul
|
|
127
|
139
|
img
|