Quellcode durchsuchen

Merge branch 'dev' of craft-in-america/vue-wp into master

tags/1.0.0
maeda vor 3 Jahren
Ursprung
Commit
eab890eeda

+ 1
- 1
plugins/cia-post-types/includes/custom-taxonomies.php Datei anzeigen

@@ -1,7 +1,7 @@
1 1
 <?php
2 2
     function create_materials_taxonomy() {
3 3
         $post_types_that_show_materials = [
4
-            'artist', 'guide', 'short',
4
+            'artist', 'exhibition', 'event', 'guide', 'short',
5 5
             'object', 'publication', 'technique'
6 6
         ];
7 7
         register_taxonomy('material', $post_types_that_show_materials, ['label' => 'Materials']);

+ 9
- 8
plugins/cia-post-types/includes/p2p-mappings.php Datei anzeigen

@@ -20,14 +20,15 @@ function register_connections_for($type, $from_types) {
20 20
 }
21 21
 
22 22
 function register_all_one_offs() {
23
-    register_connections_for('object', ['object', 'exhibition', 'guide', 'technique', 'post']);
24
-    register_connections_for('artist', ['artist', 'object', 'technique']);
25
-    register_connections_for('short', ['technique', 'short', 'object', 'guide', 'technique']);
26
-    register_connections_for('technique', ['technique', 'post']);
27
-    register_connections_for('guide', ['technique', 'exhibition', 'post']);
28
-    register_connections_for('exhibition', ['technique']);
29
-    register_connections_for('event', ['event', 'object', 'guide', 'technique']);
30
-    register_connections_for('episode', ['object', 'episode', 'guide', 'technique']);
23
+    register_connections_for('object', ['object', 'exhibition', 'guide', 'technique', 'post', 'publication']);
24
+    register_connections_for('artist', ['artist', 'object', 'technique', 'publication']);
25
+    register_connections_for('short', ['short', 'exhibition', 'event', 'object', 'guide', 'post', 'technique', 'publication']);
26
+    register_connections_for('technique', ['technique', 'post', 'publication']);
27
+    register_connections_for('guide', ['technique', 'exhibition', 'post', 'publication']);
28
+    register_connections_for('exhibition', ['exhibition','technique', 'publication']);
29
+    register_connections_for('event', ['event', 'object', 'post', 'guide', 'technique', 'publication']);
30
+    register_connections_for('episode', ['episode', 'object', 'guide', 'technique', 'publication']);
31
+    register_connections_for('post', ['post']);
31 32
 }
32 33
 
33 34
 function all_connection_types() {

+ 20
- 4
vue-theme/editor-style.css Datei anzeigen

@@ -41,7 +41,7 @@ a {
41 41
     /* leave underline to show links when editing */
42 42
     /* text-decoration: none; */
43 43
 }
44
-a &:hover {
44
+a:hover {
45 45
     cursor: pointer;
46 46
     color: black;
47 47
 }
@@ -97,17 +97,33 @@ ol {
97 97
 }
98 98
 
99 99
 /* separator types */
100
+.editor-styles-wrapper, .wp-block-separator {
101
+    border: none;
102
+    /* height: 0.8em; */
103
+    text-align: center
104
+}
105
+
100 106
 hr .wp-block-separator, .is-style-default {
101
-    height: 1px;
102 107
     width: 15vw;
108
+    border-top: 3px solid !important;
109
+    border-bottom: 0 !important;
103 110
 }
104 111
 
112
+
105 113
 hr .wp-block-separator, .is-style-wide {
106
-    height: 3px;
107 114
     width: 50vw;
115
+    border-top: 3px solid;
116
+    border-bottom: 0;
108 117
 }
109 118
 
110 119
 hr .wp-block-separator, .is-style-dots:before {
111 120
     letter-spacing: 4em;
112 121
     padding-left: 4em;
113
-}
122
+}
123
+    
124
+.wp-block-image figcaption {
125
+    position: inherit !important;
126
+    background: none !important;
127
+    color: black !important;
128
+}
129
+

+ 29
- 3
vue-theme/functions.php Datei anzeigen

@@ -220,8 +220,8 @@ add_filter( 'manage_artist_posts_columns', 'set_custom_edit_artist_columns' );
220 220
 function set_custom_edit_artist_columns($columns) {
221 221
     $date = $columns['date'];
222 222
     unset( $columns['date'] );
223
-    $columns['artist_type'] = __('Artist Type', 'my-text-domain' );
224
-    $columns['material'] = __('Material', 'my-text-xx' );
223
+    $columns['artist_type'] = __('Artist Type' );
224
+    $columns['material'] = __('Material' );
225 225
     $columns['date'] = $date;
226 226
     return $columns;
227 227
 }
@@ -247,7 +247,8 @@ add_filter( 'manage_event_posts_columns', 'set_custom_edit_event_columns' );
247 247
 function set_custom_edit_event_columns($columns) {
248 248
     $date = $columns['date'];
249 249
     unset( $columns['date'] );
250
-    $columns['event_type'] = __('Event Type');
250
+    $columns['event_type'] = __('Event Type' );
251
+    $columns['material'] = __('Material' );
251 252
     $columns['date'] = $date;
252 253
     return $columns;
253 254
 }
@@ -259,6 +260,31 @@ function custom_event_column( $column, $post_id ) {
259 260
             $terms = get_the_term_list( $post_id , 'event_type' , '' , ', ' , '' );
260 261
             echo is_string( $terms ) ? $terms : '—';
261 262
             break;
263
+            // display a list of material terms assigned to the post 
264
+        case 'material' :
265
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
266
+            echo is_string( $terms ) ? $terms : '—';
267
+            break;
268
+    }
269
+}
270
+
271
+// Add the custom columns for EXHIBITION:
272
+add_filter( 'manage_exhibition_posts_columns', 'set_custom_edit_exhibition_columns' );
273
+function set_custom_edit_exhibition_columns($columns) {
274
+    $date = $columns['date'];
275
+    unset( $columns['date'] );
276
+    $columns['material'] = __('Material');
277
+    $columns['date'] = $date;
278
+    return $columns;
279
+}
280
+// Add the data to the custom columns for EXHIBITION:
281
+add_action( 'manage_exhibition_posts_custom_column' , 'custom_exhibition_column', 10, 2 );
282
+function custom_exhibition_column( $column, $post_id ) {
283
+    switch ( $column ) {
284
+        case 'material' :
285
+            $terms = get_the_term_list( $post_id , 'material' , '' , ', ' , '' );
286
+            echo is_string( $terms ) ? $terms : '—';
287
+            break;
262 288
     }
263 289
 }
264 290
 

+ 1
- 1
vue-theme/src/components/card.vue Datei anzeigen

@@ -81,7 +81,7 @@ export default {
81 81
         padding: $ms--3
82 82
         margin: 0
83 83
     h1
84
-        font-size: $ms-0
84
+        font-size: $ms-1
85 85
         padding: 0
86 86
         line-height: initial
87 87
         display: -webkit-box

+ 34
- 26
vue-theme/src/components/footer.vue Datei anzeigen

@@ -1,7 +1,7 @@
1 1
 <template lang="pug">
2 2
 .footer-wrapper.t-up.t-sans
3 3
     footer.main.w-max.f-row.between
4
-        ul.f-col.start
4
+        ul.f-col
5 5
             //- address contact   
6 6
             li
7 7
                 h4 Craft in America
@@ -50,10 +50,10 @@
50 50
                     a(href="https://visitor.r20.constantcontact.com/d.jsp?llr=fyb4y9cab&p=oi&m=fyb4y9cab&sit=olvymhdeb&f=ee3616e1-10de-4a59-b451-1a882111b1f5", target="_blank") Join email list
51 51
                             
52 52
         //- menu links
53
-        ul.f-col.start
53
+        ul.f-col
54 54
             li
55 55
                 h5 
56
-                router-link(to="/episode") PBS Series
56
+                    router-link(to="/episode") PBS Series
57 57
                 ul.f-col.start 
58 58
                     li 
59 59
                         router-link(to="/episode") &nbsp; Episodes
@@ -64,16 +64,16 @@
64 64
             li 
65 65
                 h5
66 66
                     router-link(to="/artist") Artists
67
-                    ul.f-col.start
68
-                        li
69
-                            router-link(to="/artist/sorted/by-alpha") &nbsp; A-Z
70
-                        li
71
-                            router-link(to="/artist/sorted/by-material") &nbsp; by Material
67
+                ul.f-col
68
+                    li
69
+                        router-link(to="/artist/sorted/by-alpha") &nbsp; A-Z
70
+                    li
71
+                        router-link(to="/artist/sorted/by-material") &nbsp; by Material
72 72
 
73 73
             li
74 74
                 h5 
75
-                router-link(to="/exhibition") Exhibitions
76
-                ul.f-col.start
75
+                    router-link(to="/exhibition") Exhibitions
76
+                ul.f-col
77 77
                     li
78 78
                         router-link(to="/exhibition/sorted/by-current-and-upcoming") &nbsp; Current/Upcoming
79 79
                     li
@@ -81,34 +81,38 @@
81 81
 
82 82
             li
83 83
                 h5
84
-                router-link(to="/event") Center 
85
-                ul.f-col.start
84
+                    router-link(to="/page/center") Center 
85
+                ul.f-col
86
+                    li
87
+                        router-link(to="/page/center") &nbsp; Info
86 88
                     li
87 89
                         router-link(to="/exhibition") &nbsp; Exhibitions
88 90
                     li 
89 91
                         router-link(to="/event/sorted/by-current-and-upcoming") &nbsp; Events 
90 92
                     li
91
-                        router-link(to="/event/sorted/by-type&talks") &nbsp; Talks &amp; Interviews
93
+                        router-link(to="/event?type=talks") &nbsp; Talks &amp; Interviews
92 94
             li
93 95
                 h5
94
-                router-link(to="") Education 
95
-                ul.f-col.start
96
+                    router-link(to="") Education 
97
+                ul.f-col
96 98
                     li
97 99
                         router-link(to="/guide") &nbsp; Guides 
98 100
                     li 
99 101
                         router-link(to="/publication") &nbsp; Publications 
102
+                    li 
103
+                        router-link(to="/page/library") &nbsp; Library 
100 104
 
101 105
 
102 106
             li
103 107
                 h5
104
-                router-link(to="") News
105
-                ul.f-col.start
108
+                    router-link(to="") News
109
+                ul.f-col
106 110
                     li
107 111
                         router-link(to="/blog") &nbsp; Blog Posts  
108 112
                     li 
109
-                        router-link(to="/blog/sorted/by-type&releases") &nbsp; Press Releases 
113
+                        router-link(to="/posts?type=releases") &nbsp; Press Releases 
110 114
                     li 
111
-                        router-link(to="/blog/sorted/by-type&articles") &nbsp; In the News 
115
+                        router-link(to="/posts?type=articles") &nbsp; In the News 
112 116
 
113 117
     .sub-footer.f-col.start
114 118
         h6 Craft in America &copy; 2010&ndash;{{ today }} 
@@ -138,6 +142,8 @@ export default {
138 142
     footer.main
139 143
         display: flex
140 144
         flex-wrap: wrap
145
+        align-items: flex-start 
146
+
141 147
         min-width: $min-width
142 148
         /* background-color: $cia_red */
143 149
         // ALL <ul> tags
@@ -148,15 +154,17 @@ export default {
148 154
                 width: 100%
149 155
         // OUTER <ul> tags
150 156
         > ul
151
-            padding: 0 $ms-0
157
+            padding: $ms-0
152 158
             &:nth-child(n+2)
153
-                padding: 0 $ms-0 $ms-3 $ms-0
159
+                /* padding: 0 $ms-0 $ms-3 $ms-0 */
154 160
             > li
155 161
                 color: $cia_white
156
-                padding: $ms-0 0 0
157
-                h5
158
-                    color: $cia_white
159
-                    margin: $ms-0 0 $ms--1
162
+                padding: 0 0 $ms--6
163
+                h4
164
+                    margin: $ms-0 0 $ms--3
165
+                h5 
166
+                    /* margin: $ms-0 0 $ms--1 */
167
+                    margin: $ms-0 0 0
160 168
                 a, a:link, a:visited
161 169
                     color: $cia_white
162 170
                     text-decoration: none
@@ -208,7 +216,7 @@ export default {
208 216
             /* background-color: rebeccapurple */
209 217
             background-color: $cia_red
210 218
             &:nth-child(n+2)
211
-                margin: 0 0 $ms-2 0
219
+                /* margin: 0 0 $ms-2 0 */
212 220
                 > li
213 221
                     width: 43%
214 222
     /* 1200px */

+ 1
- 1
vue-theme/src/components/navigation/navigation.vue Datei anzeigen

@@ -51,7 +51,7 @@ nav.main.w-max
51 51
                     li
52 52
                         router-link(to="/event/sorted/by-current-and-upcoming") Events Current/Upcoming
53 53
                     li
54
-                        router-link(to="/event/sorted/by-type") Talks & Interviews
54
+                        router-link(to="/event?type=talks") Talks & Interviews
55 55
                     li
56 56
                         router-link(to="/page/library") Library
57 57
             li.f-grow

+ 71
- 22
vue-theme/src/components/sidebars/sidebar.vue Datei anzeigen

@@ -5,17 +5,30 @@ aside.sidebar
5 5
         .shadow(v-if="shouldShowListSort.includes(type) && layout !== 'single'")
6 6
             h3.t-up sort {{ type }}
7 7
             ul.t-up
8
+                li 
9
+                    //- ?type=articles //
10
+                    router-link(v-if="type === 'post' " :to="`/${type}?type=articles`")
11
+                        p in the news
12
+                li 
13
+                    //- ?type=releases //
14
+                    router-link(v-if="type === 'post' " :to="`/${type}?type=releases`")
15
+                        p press releases 
16
+                li 
17
+                    //- ?type=talks //
18
+                    router-link(v-if="type === 'event' " :to="`/${type}?type=talks`")
19
+                        p talks 
20
+                    //- by type //
8 21
                 li(v-for="option in sortOptions")
9 22
                     router-link(:to="`/${type}/sorted/${sortTypes[option]}`")
10 23
                         p {{ option }}
11 24
                 li
12
-                    router-link(:to="`/${type}`")
13
-                        p by all
14
-                li
15
-                    router-link(v-if="shouldShowDateSort.includes(type) && layout !== 'single'" :to="`/${type}/sorted/by-current-and-upcoming`")
25
+                    router-link(v-if="shouldShowDateSort.includes(type) " :to="`/${type}/sorted/by-current-and-upcoming`")
16 26
                         p by current and upcoming
27
+                li
28
+                    router-link(:to="`/${type}/sorted/by-date`")
29
+                        p by all
17 30
         
18
-        //- if {{type}} sorted by-material show material options
31
+        //- if {{type}} has sorted by-material show material options
19 32
         .shadow(v-if="shouldShowMaterialSort.includes(type) && layout !== 'single'")
20 33
             h3.t-up {{ type }} by material
21 34
             ul.t-up
@@ -24,14 +37,14 @@ aside.sidebar
24 37
                         router-link(:to="`/${type}/sorted/by-material#${material}`")
25 38
                             p {{ material }}
26 39
 
27
-        //- if artist sorted by-alpha show alpha options           
40
+        //- if artist has sorted by-alpha show alpha options           
28 41
         .shadow(v-if="['artist'].includes(type) && layout !== 'single'")
29 42
             h3.t-up {{ type }} alpha 
30 43
             ul.t-up
31
-                li
44
+                li.f-row.start.wrap
32 45
                     template(v-for="charaSet in charaSets") 
33 46
                         router-link(:to="`/${type}/sorted/by-alpha#${charaSet[0]}`")
34
-                            p {{ charaSet }}
47
+                            p.alpha {{ charaSet }}
35 48
 
36 49
         //- p2p types and related posts
37 50
         .shadow(v-if="layout === 'single' && Object.keys(related).length" v-for="p2pPostType in Object.keys(related)")
@@ -85,15 +98,20 @@ export default {
85 98
     data() {
86 99
         return {
87 100
             sortTypes: {
88
-                alphabetized: `${sortTypes.alpha}`,       //:0
89
-                'by material': `${sortTypes.material}`,   //:1
90
-                'by artist': `${sortTypes.artist}`,       //:2
91
-                'by episode': `${sortTypes.episode}`,     //:3
101
+                alphabetized: `${sortTypes.alpha}`,     //:0
102
+                'by material': `${sortTypes.material}`, //:1
103
+                'by artist': `${sortTypes.artist}`,     //:2
104
+                'by episode': `${sortTypes.episode}`,   //:3
105
+                'by type': `${sortTypes.subtype}`,      //:4
106
+                // 'by articles': `articles`,              //:5
107
+                subtype: 'by-type',
92 108
             },
93 109
             charaSets: [
94
-                '0 a b', 'c d e', 'f g h',
95
-                'i j k', 'l m n', 'o p q',
96
-                'r s t', 'u v w', 'x y z'
110
+                // '0 a b', 'c d e', 'f g h',
111
+                // 'i j k', 'l m n', 'o p q',
112
+                // 'r s t', 'u v w', 'x y z'
113
+                '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 
114
+                'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
97 115
             ],
98 116
             materials: materials,
99 117
             shouldShowListSort: [
@@ -102,7 +120,7 @@ export default {
102 120
                 'publication', 'technique', 'post'
103 121
             ],
104 122
             shouldShowMaterialSort: [
105
-                'artist', 
123
+                'artist', 'exhibition', 'event',
106 124
                 'short', 'guide', 'object',
107 125
                 'technique',
108 126
             ],
@@ -114,7 +132,7 @@ export default {
114 132
             ],
115 133
             shouldShowTypeSort: [
116 134
                 'short', 'guide', 'object',
117
-                'publication', 'technique', 'post'
135
+                'publication', 'technique', 'post', 'event'
118 136
             ]
119 137
         }
120 138
     },
@@ -127,12 +145,28 @@ export default {
127 145
                         Object.keys(this.sortTypes)[0],
128 146
                         Object.keys(this.sortTypes)[3],
129 147
                         Object.keys(this.sortTypes)[1],
130
-                        `by ${this.type} type`,
148
+                        Object.keys(this.sortTypes)[4],
149
+                        // `by ${this.type} type`,
150
+                    ]
151
+                    break
152
+                case 'exhibition':
153
+                    opts = [
154
+                        // Object.keys(this.sortTypes)[4],
155
+                        // Object.keys(this.sortTypes)[1],
156
+                    ]
157
+                    break
158
+                case 'event':
159
+                    opts = [
160
+                        // Object.keys(this.sortTypes)[4],
161
+                        // Object.keys(this.sortTypes)[1],
131 162
                     ]
132 163
                     break
133 164
                 case 'post':
134 165
                     opts = [
135
-                        `by ${this.type} type`,
166
+                        Object.keys(this.sortTypes)[4],
167
+                        // `by ${this.type} type`,
168
+                        // Object.keys(this.sortTypes)[5],
169
+                        // `by articles`
136 170
                     ]
137 171
                     break
138 172
                 case 'short':
@@ -176,7 +210,7 @@ export default {
176 210
 @import '../../sss/theme.sss'
177 211
 aside.sidebar
178 212
     /* need to solve for mobile as the sticky creates scroll issues */
179
-    /* position: sticky */
213
+    position: sticky
180 214
     top: 40px
181 215
     width: 100%
182 216
     p, h3
@@ -187,6 +221,7 @@ aside.sidebar
187 221
         > *
188 222
             padding: $ms-0
189 223
             margin: 0 0 $ms-0 0
224
+            display: table-cell
190 225
         > .post
191 226
             /* background-color: blue */
192 227
     ul
@@ -195,17 +230,31 @@ aside.sidebar
195 230
         flex-direction: column
196 231
         flex-wrap: wrap 
197 232
         li
198
-            padding: 0 0 $ms-0 0
233
+            /* padding: 0 0 $ms-0 0 */
199 234
             img
200
-                width: 100%
235
+                display: none
236
+                padding: $ms-0 0 $ms--4 0
237
+            p.alpha 
238
+                padding: 0 $ms--4
239
+
201 240
     .shadow
202 241
         background-color: white
203 242
 
243
+
204 244
 /* width larger than $medium  */
205 245
 @media (min-width: $medium)
206 246
     aside.sidebar
247
+        position: sticky
207 248
         min-width: 25%
208 249
         width: 25%
250
+        > section 
251
+            > * 
252
+                display: inherit 
209 253
         ul
210 254
             flex-direction: column
255
+            li 
256
+                img
257
+                    display: block  
258
+                    width: 100%
259
+
211 260
 </style>

+ 137
- 70
vue-theme/src/pages/list.vue Datei anzeigen

@@ -4,7 +4,8 @@
4 4
 
5 5
         header.center.t-up
6 6
             .title.f-row
7
-                h3(v-if="!isSearch") {{ type }}s&nbsp;
7
+                h3(v-if="!isSearch && !hasSubtype") {{ type }}s&nbsp;
8
+                h3(v-else-if="hasSubtype") {{ type }}s: {{ $route.query.type }}&nbsp;
8 9
                 h3(v-else) Search results for: {{$route.query.s }}&nbsp;
9 10
                 span(v-if="sortBy")
10 11
                     h3 {{ sortBy.replace('-', ' ') }}
@@ -58,7 +59,15 @@ export default {
58 59
     },
59 60
     computed: {
60 61
         type() {
61
-            return postTypes.includes(this.$route.params.type) ? this.$route.params.type : 'post'
62
+            return postTypes.includes(this.$route.params.type)
63
+                ? this.$route.params.type
64
+                : 'post'
65
+        },
66
+        hasSearchTerm() {
67
+            return this.$route.query.s
68
+        },
69
+        hasSubtype() {
70
+            return this.$route.query.type
62 71
         },
63 72
         sortBy() {
64 73
             return this.$route.params.sortBy
@@ -76,67 +85,83 @@ export default {
76 85
             return !sansSidebarTypes.includes(this.type)
77 86
         },
78 87
         pType() {
79
-            if(!this.type) return
88
+            if (!this.type) return
80 89
             return `${convertTitleCase(this.type)}s`
81 90
         },
82 91
         loaded() {
83 92
             if (!this.pType) return
84
-            return this.isSearch ? this['allSearchResultsLoaded'] : this[`all${this.pType}Loaded`]
93
+            return this.isSearch
94
+                ? this['allSearchResultsLoaded']
95
+                : this[`all${this.pType}Loaded`]
85 96
         },
86 97
         posts() {
87 98
             if (!this.pType) return
88
-            return this.isSearch ? this['allSearchResults'] : this[`all${this.pType}`]
99
+            return this.isSearch
100
+                ? this['allSearchResults']
101
+                : this[`all${this.pType}`]
89 102
         },
90 103
         shouldLoadAllAtOnce() {
91
-            return this.type == 'episode' ||
104
+            return (
105
+                this.type == 'episode' ||
92 106
                 this.sortBy == sortTypes.subtype ||
93 107
                 this.sortBy == sortTypes.material ||
94 108
                 this.sortBy == sortTypes.episode
95
-        }
109
+            )
110
+        },
96 111
     },
97 112
     methods: {
98 113
         async loadMoreSearchResults() {
99
-            if(!this.keepFetching) return console.warn('Nothing left to fetch...')
114
+            if (!this.keepFetching)
115
+                return console.warn('Nothing left to fetch...')
100 116
             const getPosts = async params => {
101
-                return await this.$store.dispatch(`getMoreSearchResults`, { params })
117
+                return await this.$store.dispatch(`getMoreSearchResults`, {
118
+                    params,
119
+                })
102 120
             }
103 121
             try {
104 122
                 this.loadingFetched = true
105 123
                 this.page++
106
-                const res = await getPosts(
107
-                    {
108
-                        limit: this.perPage,
109
-                        page: this.page,
110
-                        s: this.searchTerm
111
-                    }
112
-                )
124
+                const res = await getPosts({
125
+                    limit: this.perPage,
126
+                    page: this.page,
127
+                    s: this.searchTerm,
128
+                })
113 129
                 this.loadingFetched = false
114 130
                 // Stop trying to load more posts
115
-                if(res && !res.length) {
131
+                if (res && !res.length) {
116 132
                     this.keepFetching = false
117
-                    if(!res.length) console.warn(`Empty response for search results:`, res.length)
133
+                    if (!res.length)
134
+                        console.warn(
135
+                            `Empty response for search results:`,
136
+                            res.length,
137
+                        )
118 138
                 }
119
-            } catch (err) { console.error(err) }
139
+            } catch (err) {
140
+                console.error(err)
141
+            }
120 142
         },
121 143
         async loadMorePosts(shouldClear) {
122
-            if(!this.keepFetching) return console.warn('Nothing left to fetch...')
144
+            if (!this.keepFetching)
145
+                return console.warn('Nothing left to fetch...')
123 146
 
124
-            const getPosts = async  (params, dispatchType) => {
125
-                if(!this.type) throw `post type: ${this.type} not found...`
147
+            const getPosts = async (params, dispatchType) => {
148
+                if (!this.type) throw `post type: ${this.type} not found...`
126 149
                 console.log(`Getting more ${this.type} posts`)
127 150
                 // We always grab all pages on hero init so no need to do it here
128
-                return this.pType && this.type != 'page' ? await this.$store.dispatch(
129
-                    `get${dispatchType}${this.pType}`,
130
-                    { sortType: this.sortBy, params }
131
-                ) : []
151
+                return this.pType && this.type != 'page'
152
+                    ? await this.$store.dispatch(
153
+                          `get${dispatchType}${this.pType}`,
154
+                          { sortType: this.sortBy, params },
155
+                      )
156
+                    : []
132 157
             }
133 158
 
134
-            if(shouldClear) {
159
+            if (shouldClear) {
135 160
                 this.$store.commit(`CLEAR_${this.pType.toUpperCase()}`)
136
-                
161
+
137 162
                 // Clear any state needed to track title inbetweens
138 163
                 const hasInbetweens = ['artist']
139
-                if(hasInbetweens.includes(this.type)) {
164
+                if (hasInbetweens.includes(this.type)) {
140 165
                     this.$store.commit(`CLEAR_${this.pType.toUpperCase()}_SEEN`)
141 166
                 }
142 167
             }
@@ -144,73 +169,102 @@ export default {
144 169
             try {
145 170
                 this.loadingFetched = true
146 171
                 this.page++
147
-                console.log('shouldLoadAll :', this.shouldLoadAllAtOnce, this.type)
172
+                // console.log('shouldLoadAll :', this.shouldLoadAllAtOnce, this.type)
173
+                const params = {
174
+                    limit: this.shouldLoadAllAtOnce ? -1 : this.perPage,
175
+                    page: this.page,
176
+                }
177
+                if (this.hasSubtype) {
178
+                    params.type = this.$route.query.type
179
+                }
148 180
                 const res = await getPosts(
149
-                    {
150
-                        limit: this.shouldLoadAllAtOnce ? -1 : this.perPage,
151
-                        page: this.page
152
-                    },
153
-                    this.shouldLoadAllAtOnce ? 'All' : 'More'
181
+                    params,
182
+                    this.shouldLoadAllAtOnce ? 'All' : 'More',
154 183
                 )
155 184
                 this.loadingFetched = false
156 185
 
157 186
                 // Stop trying to load more posts
158
-                if(res && !res.length || this.shouldLoadAllAtOnce) {
187
+                if ((res && !res.length) || this.shouldLoadAllAtOnce) {
159 188
                     this.keepFetching = false
160
-                    if(!res.length) console.warn(`Empty response for ${this.type}:`, res.length)
161
-                    if(this.shouldLoadAllAtOnce) console.warn(`Fetched all responses for ${this.type}:`, res.length)
189
+                    if (!res.length)
190
+                        console.warn(
191
+                            `Empty response for ${this.type}:`,
192
+                            res.length,
193
+                        )
194
+                    if (this.shouldLoadAllAtOnce)
195
+                        console.warn(
196
+                            `Fetched all responses for ${this.type}:`,
197
+                            res.length,
198
+                        )
162 199
                 }
163
-            } catch (err) { console.error(err) }
200
+            } catch (err) {
201
+                console.error(err)
202
+            }
164 203
         },
165 204
         async getPage(type) {
166 205
             await this._getAllIfNotLoaded('page', this.$store)
167
-            if(!this.allPages) throw 'no pages in state'
206
+            if (!this.allPages) throw 'no pages in state'
168 207
             const page = this.allPages.filter(page => page.slug == `${type}`)[0]
169
-            if(!page) throw `No page: ${type} found. Cannot set hero.`
208
+            if (!page) throw `No page: ${type} found. Cannot set hero.`
170 209
             return page
171 210
         },
172 211
         // _setHeroInfo(post) {} from mixin
173 212
         // _clearHero(store) {} from mixin
174 213
         async checkAndSetHero(type) {
214
+            // console.log('hero type :', type)
175 215
             this._clearHero(this.$store)
176 216
             try {
177 217
                 const page = await this.getPage(type)
178 218
                 // We always set a hero no matter what
179 219
                 // Because the hero component will deal
180 220
                 // with how to render based on hero.url
181
-                this.$store.commit('SET_HERO', this._setHeroInfo(page))
182
-            } catch (err) { console.error(err) }
221
+                const heroJson = this._setHeroInfo(page)
222
+                heroJson.subtype = this.$route.query.type
223
+                console.log(heroJson)
224
+                this.$store.commit('SET_HERO', heroJson)
225
+            } catch (err) {
226
+                console.error(err)
227
+            }
183 228
         },
184 229
         setIntersectionLoader(cb) {
185 230
             // KeepFetching is UNSET for certain post types and sort types in `loadMorePosts()`
186
-            if(!this.keepFetching) return console.warn('Cannot setup intersection handler keepFetching is set false')
187
-            
231
+            if (!this.keepFetching)
232
+                return console.warn(
233
+                    'Cannot setup intersection handler keepFetching is set false',
234
+                )
235
+
188 236
             // Always unset before setting the intersection loader
189 237
             this.unsetIntersectionLoader()
190 238
 
191 239
             // console.warn('Setting interesection loader...')
192
-            this.observer = new IntersectionObserver(entries => {
193
-                entries.forEach(entry => {
194
-                    if (!entry.isIntersecting || this.loadingFetched) return
195
-                    setTimeout(cb, TIMEOUT)
196
-                })
197
-            }, { threshold: 0.80 })
240
+            this.observer = new IntersectionObserver(
241
+                entries => {
242
+                    entries.forEach(entry => {
243
+                        if (!entry.isIntersecting || this.loadingFetched) return
244
+                        setTimeout(cb, TIMEOUT)
245
+                    })
246
+                },
247
+                { threshold: 0.8 },
248
+            )
198 249
             this.observer.observe(document.querySelector(INTERSECT_SELECTOR))
199 250
         },
200 251
         unsetIntersectionLoader() {
201 252
             const footerEl = document.querySelector(INTERSECT_SELECTOR)
202 253
             try {
203
-                if(!footerEl) throw `Cannot unset intersection handler missing el: ${footerEl}`
204
-                if(!this.observer) return 
254
+                if (!footerEl)
255
+                    throw `Cannot unset intersection handler missing el: ${footerEl}`
256
+                if (!this.observer) return
205 257
                 this.observer.unobserve(footerEl)
206 258
                 this.observer.disconnect()
207
-            } catch (error) { console.error(error) }
259
+            } catch (error) {
260
+                console.error(error)
261
+            }
208 262
         },
209 263
         initPostList() {
210 264
             this.page = 0
211 265
             this.keepFetching = true
212 266
 
213
-            if(this.isSearch) {
267
+            if (this.isSearch) {
214 268
                 this.checkAndSetHero(`search`)
215 269
                 this.$store.commit(`CLEAR_SEARCH_RESULTS`)
216 270
                 this.loadMoreSearchResults()
@@ -222,30 +276,43 @@ export default {
222 276
                 this.loadMorePosts(true)
223 277
                 this.setIntersectionLoader(this.loadMorePosts)
224 278
             }
225
-        }
226
-    },
227
-    beforeRouteUpdate(to, from) {
228
-        // !: Only fires between two searches
229
-        if(!to.query || to.query.s == from.query.s) return
230
-        console.log('between route search')
231
-        // Set the search term for impending callback fire
232
-        this.searchTerm = to.query.s
233
-        this.initPostList()
279
+        },
234 280
     },
235 281
     watch: {
282
+        // Fires no matter what
283
+        hasSearchTerm(newTerm, oldTerm) {
284
+            this.searchTerm = newTerm
285
+            if (newTerm && newTerm != oldTerm) {
286
+                this.initPostList()
287
+            }
288
+        },
289
+        hasSubtype(newSubtype, oldSubtype) {
290
+            if (newSubtype && newSubtype != oldSubtype) {
291
+                this.initPostList()
292
+            }
293
+            if (!newSubtype && oldSubtype) {
294
+                this.initPostList()
295
+            }
296
+        },
236 297
         // This only fires navigating from a list page, to another list page
237 298
         type(newType) {
238
-            if(!postTypes.includes(newType)) return console.warn('Type not valid...')
299
+            if (!postTypes.includes(newType))
300
+                return console.warn('Type not valid...')
239 301
 
240 302
             // Ignore some types with presorts so the sortBy watcher can handle them
241
-            const ignore = ['artist', 'event', 'exibition']
242
-            if(ignore.includes(newType)) return
303
+            const ignore = ['artist']
304
+            if (ignore.includes(newType)) {
305
+                return
306
+            }
307
+            // Reset the search term betweem loads
308
+            // so we initPostList() works correctly when
309
+            // navigating from search result to a type list page
310
+            this.searchTerm = this.$route.query.s
243 311
             this.initPostList()
244 312
         },
245 313
         // Fires when navigating between pages with different sorts
246 314
         sortBy(newSort) {
247
-            // console.log('sort changed :', newSort)
248
-            if(!Object.values(sortTypes).includes(newSort)) return
315
+            if (!Object.values(sortTypes).includes(newSort)) return
249 316
             this.initPostList()
250 317
         },
251 318
     },
@@ -255,7 +322,7 @@ export default {
255 322
     },
256 323
     beforeUnmount() {
257 324
         this.unsetIntersectionLoader()
258
-    }
325
+    },
259 326
 }
260 327
 </script>
261 328
 

+ 1
- 2
vue-theme/src/pages/mixin-post-types.js Datei anzeigen

@@ -47,7 +47,7 @@ const scrollTop = {
47 47
 const heroUtils = {
48 48
     methods: {
49 49
         _setHeroInfo(post) {
50
-            let json = { url: post.featured, heroType:'image' }
50
+            let json = { url: post.featured, heroType: 'image' }
51 51
             if (
52 52
                 post.hero &&
53 53
                 JSON.parse(post.hero) &&
@@ -86,7 +86,6 @@ const heroUtils = {
86 86
             }
87 87
            
88 88
             // post.type == 'page' && post.slug == 'thing' || post.type == 'page' && post.slug == 'otherthing'
89
-
90 89
             return json
91 90
         },
92 91
         _clearHero(store) {

+ 11
- 3
vue-theme/src/pages/single.vue Datei anzeigen

@@ -248,7 +248,7 @@ export default {
248 248
         background-color: white
249 249
         padding: $ms-0
250 250
         h1
251
-            color: $cia_black
251
+            /* color: $cia_black */
252 252
             margin: 0 0 $ms--3 0
253 253
         > ul
254 254
             /* grid-gap: $ms-0 */
@@ -270,6 +270,16 @@ export default {
270 270
                 position: absolute
271 271
                 top: 100%
272 272
 
273
+        .wp-block-gallery
274
+            margin: 0 0 0.5em 0
275
+            grid-gap: $ms--5
276
+            
277
+            > .wp-block-image     
278
+                figcaption
279
+                    position: inherit
280
+                    background: none
281
+                    color: $cia_black
282
+
273 283
         /* iframe container 16:9 */
274 284
         [class^="iframe-container"]
275 285
             position: relative
@@ -291,10 +301,8 @@ export default {
291 301
             margin: $ms-2 auto
292 302
             &.is-style
293 303
                 &-default
294
-                    height: 1px
295 304
                     width: 15vw
296 305
                 &-wide
297
-                    height: 3px
298 306
                     width: 50vw
299 307
                 &-dots::before
300 308
                     outline-style: none

+ 2
- 2
vue-theme/src/sss/_typography.sss Datei anzeigen

@@ -27,11 +27,11 @@
27 27
         font-family: $mono
28 28
 
29 29
 a
30
-    /* text-decoration: none,  leave for now to show links underlined */
30
+    text-decoration: none  // comment out to show underline
31 31
     &:hover
32 32
         cursor: pointer
33 33
 
34
-h1, h2, h3, h4, h5, h6 /* common */
34
+h1, h2, h3, h4, h5, h6 //common attributes
35 35
     /* font-weight: 400 */
36 36
     display: block
37 37
     margin-left: 0

+ 20
- 21
vue-theme/src/sss/variables.sss Datei anzeigen

@@ -15,27 +15,26 @@ $base: 0.95em
15 15
 $max-card-img-height: 420px
16 16
 $card-line-clamp: 3
17 17
 
18
-$ratio: $minor-third
19
-/* $ratio = 1.2 from _ratios.sss */
20
-
21
-$ms-0: calc($base)
22
-$ms--1: calc($ms-0 / $ratio)
23
-$ms--2: calc($ms--1 / $ratio)
24
-$ms--3: calc($ms--2 / $ratio)
25
-$ms--4: calc($ms--3 / $ratio)
26
-$ms--5: calc($ms--4 / $ratio)
27
-$ms--6: calc($ms--5 / $ratio)
28
-$ms--7: calc($ms--6 / $ratio)
29
-
30
-$ms-1: calc($ms-0 * $ratio)
31
-$ms-2: calc($ms-1 * $ratio)
32
-$ms-3: calc($ms-2 * $ratio)
33
-$ms-4: calc($ms-3 * $ratio)
34
-$ms-5: calc($ms-4 * $ratio)
35
-$ms-6: calc($ms-5 * $ratio)
36
-$ms-7: calc($ms-6 * $ratio)
37
-$ms-8: calc($ms-7 * $ratio)
38
-$ms-9: calc($ms-8 * $ratio)
18
+$ratio: $minor-third // $ratio = 1.2 from _ratios.sss
19
+
20
+$ms-0: calc($base) // 0.95em
21
+$ms--1: calc($ms-0 / $ratio) // 0.79
22
+$ms--2: calc($ms--1 / $ratio) // 0.66
23
+$ms--3: calc($ms--2 / $ratio) // 0.55
24
+$ms--4: calc($ms--3 / $ratio) // 0.45
25
+$ms--5: calc($ms--4 / $ratio) // 0.38
26
+$ms--6: calc($ms--5 / $ratio) // 0.31
27
+$ms--7: calc($ms--6 / $ratio) // 0.27
28
+
29
+$ms-1: calc($ms-0 * $ratio) // 1.14
30
+$ms-2: calc($ms-1 * $ratio) // 1.368
31
+$ms-3: calc($ms-2 * $ratio) // 1.6416
32
+$ms-4: calc($ms-3 * $ratio) // 1.9699
33
+$ms-5: calc($ms-4 * $ratio) // 2.3639
34
+$ms-6: calc($ms-5 * $ratio) // 2.8366
35
+$ms-7: calc($ms-6 * $ratio) // 3.4040
36
+$ms-8: calc($ms-7 * $ratio) // 4.0848
37
+$ms-9: calc($ms-8 * $ratio) // 4.9018
39 38
 
40 39
 /* Fonts */
41 40
 $sans: 'Questrial', sans-serif

+ 1
- 1
vue-theme/src/store/index.js Datei anzeigen

@@ -49,7 +49,7 @@ const mutations = {
49 49
             state.hero.playbutton = false
50 50
         } else {
51 51
             // console.warn('Setting hero', hero)
52
-            state.hero.text = hero.text
52
+            state.hero.text = hero.subtype ? hero.subtype : hero.text
53 53
             state.hero.url = hero.url
54 54
             state.hero.type = hero.heroType
55 55
 

+ 4
- 1
vue-theme/src/utils/api.js Datei anzeigen

@@ -14,6 +14,8 @@ const constructQuery = (params) => {
14 14
 
15 15
     if(params.limit && params.page && params.s) {
16 16
         query = `?s=${params.s}&limit=${params.limit}&p=${params.page}`
17
+    } else if(params.limit && params.page && !params.s && params.type) {
18
+        query = `?type=${params.type}&limit=${params.limit}&p=${params.page}`
17 19
     } else if(params.limit && params.page && !params.s) {
18 20
         query = `?limit=${params.limit}&p=${params.page}`
19 21
     } else if(params.limit && !params.page) {
@@ -26,7 +28,8 @@ export default {
26 28
     getByType({ type, sort, params, cb }) {
27 29
         const query = constructQuery(params)
28 30
         if (sort && Object.values(sortTypes).includes(sort)) {
29
-            console.log('---')
31
+            console.log(params)
32
+            // console.log('---')
30 33
             return axios
31 34
                 .get(SETTINGS.API_BASE_PATH + `sort/${type}/${sort}${query}`)
32 35
                 .then(response => {

+ 6
- 11
vue-theme/src/utils/helpers.js Datei anzeigen

@@ -3,24 +3,17 @@ const convertTitleCase = type => {
3 3
     return type.charAt(0).toUpperCase() + type.slice(1)
4 4
 }
5 5
 
6
-const materials = [
7
-    'clay',
8
-    'fiber',
9
-    'glass',
10
-    'metal',
11
-    'paper',
12
-    'wood'
13
-]
6
+const materials = ['clay', 'fiber', 'glass', 'metal', 'paper', 'wood']
14 7
 
15 8
 const sortTypes = {
16 9
     alpha: 'by-alpha',
17
-    recent: 'by-recent',
18 10
     material: 'by-material',
19 11
     artist: 'by-artist',
20 12
     episode: 'by-episode',
21 13
     upcoming: 'by-upcoming',
22 14
     current: 'by-current',
23 15
     subtype: 'by-type',
16
+    date: 'by-date',
24 17
     currentAndUpcoming: 'by-current-and-upcoming',
25 18
     past: 'by-past',
26 19
 }
@@ -81,7 +74,9 @@ const ytThumbnail = (url, desiredSize) => {
81 74
 
82 75
 const formatDate = (unix, includeTime) => {
83 76
     const d = new Date(parseInt(unix) * 1000)
84
-    return includeTime ? d.toLocaleString('en-US', { timeZone: 'UTC' }) : d.toLocaleDateString('en-US', { timeZone: 'UTC' })
77
+    return includeTime
78
+        ? d.toLocaleString('en-US', { timeZone: 'UTC' })
79
+        : d.toLocaleDateString('en-US', { timeZone: 'UTC' })
85 80
 }
86 81
 
87 82
 export {
@@ -90,5 +85,5 @@ export {
90 85
     sortTypes,
91 86
     postTypes,
92 87
     ytThumbnail,
93
-    formatDate
88
+    formatDate,
94 89
 }

Laden…
Abbrechen
Speichern