Преглед на файлове

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

tags/1.0.0
maeda преди 3 години
родител
ревизия
eab890eeda

+ 1
- 1
plugins/cia-post-types/includes/custom-taxonomies.php Целия файл

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

+ 9
- 8
plugins/cia-post-types/includes/p2p-mappings.php Целия файл

20
 }
20
 }
21
 
21
 
22
 function register_all_one_offs() {
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
 function all_connection_types() {
34
 function all_connection_types() {

+ 20
- 4
vue-theme/editor-style.css Целия файл

41
     /* leave underline to show links when editing */
41
     /* leave underline to show links when editing */
42
     /* text-decoration: none; */
42
     /* text-decoration: none; */
43
 }
43
 }
44
-a &:hover {
44
+a:hover {
45
     cursor: pointer;
45
     cursor: pointer;
46
     color: black;
46
     color: black;
47
 }
47
 }
97
 }
97
 }
98
 
98
 
99
 /* separator types */
99
 /* separator types */
100
+.editor-styles-wrapper, .wp-block-separator {
101
+    border: none;
102
+    /* height: 0.8em; */
103
+    text-align: center
104
+}
105
+
100
 hr .wp-block-separator, .is-style-default {
106
 hr .wp-block-separator, .is-style-default {
101
-    height: 1px;
102
     width: 15vw;
107
     width: 15vw;
108
+    border-top: 3px solid !important;
109
+    border-bottom: 0 !important;
103
 }
110
 }
104
 
111
 
112
+
105
 hr .wp-block-separator, .is-style-wide {
113
 hr .wp-block-separator, .is-style-wide {
106
-    height: 3px;
107
     width: 50vw;
114
     width: 50vw;
115
+    border-top: 3px solid;
116
+    border-bottom: 0;
108
 }
117
 }
109
 
118
 
110
 hr .wp-block-separator, .is-style-dots:before {
119
 hr .wp-block-separator, .is-style-dots:before {
111
     letter-spacing: 4em;
120
     letter-spacing: 4em;
112
     padding-left: 4em;
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 Целия файл

220
 function set_custom_edit_artist_columns($columns) {
220
 function set_custom_edit_artist_columns($columns) {
221
     $date = $columns['date'];
221
     $date = $columns['date'];
222
     unset( $columns['date'] );
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
     $columns['date'] = $date;
225
     $columns['date'] = $date;
226
     return $columns;
226
     return $columns;
227
 }
227
 }
247
 function set_custom_edit_event_columns($columns) {
247
 function set_custom_edit_event_columns($columns) {
248
     $date = $columns['date'];
248
     $date = $columns['date'];
249
     unset( $columns['date'] );
249
     unset( $columns['date'] );
250
-    $columns['event_type'] = __('Event Type');
250
+    $columns['event_type'] = __('Event Type' );
251
+    $columns['material'] = __('Material' );
251
     $columns['date'] = $date;
252
     $columns['date'] = $date;
252
     return $columns;
253
     return $columns;
253
 }
254
 }
259
             $terms = get_the_term_list( $post_id , 'event_type' , '' , ', ' , '' );
260
             $terms = get_the_term_list( $post_id , 'event_type' , '' , ', ' , '' );
260
             echo is_string( $terms ) ? $terms : '—';
261
             echo is_string( $terms ) ? $terms : '—';
261
             break;
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 Целия файл

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

+ 34
- 26
vue-theme/src/components/footer.vue Целия файл

1
 <template lang="pug">
1
 <template lang="pug">
2
 .footer-wrapper.t-up.t-sans
2
 .footer-wrapper.t-up.t-sans
3
     footer.main.w-max.f-row.between
3
     footer.main.w-max.f-row.between
4
-        ul.f-col.start
4
+        ul.f-col
5
             //- address contact   
5
             //- address contact   
6
             li
6
             li
7
                 h4 Craft in America
7
                 h4 Craft in America
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
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
         //- menu links
52
         //- menu links
53
-        ul.f-col.start
53
+        ul.f-col
54
             li
54
             li
55
                 h5 
55
                 h5 
56
-                router-link(to="/episode") PBS Series
56
+                    router-link(to="/episode") PBS Series
57
                 ul.f-col.start 
57
                 ul.f-col.start 
58
                     li 
58
                     li 
59
                         router-link(to="/episode") &nbsp; Episodes
59
                         router-link(to="/episode") &nbsp; Episodes
64
             li 
64
             li 
65
                 h5
65
                 h5
66
                     router-link(to="/artist") Artists
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
             li
73
             li
74
                 h5 
74
                 h5 
75
-                router-link(to="/exhibition") Exhibitions
76
-                ul.f-col.start
75
+                    router-link(to="/exhibition") Exhibitions
76
+                ul.f-col
77
                     li
77
                     li
78
                         router-link(to="/exhibition/sorted/by-current-and-upcoming") &nbsp; Current/Upcoming
78
                         router-link(to="/exhibition/sorted/by-current-and-upcoming") &nbsp; Current/Upcoming
79
                     li
79
                     li
81
 
81
 
82
             li
82
             li
83
                 h5
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
                     li
88
                     li
87
                         router-link(to="/exhibition") &nbsp; Exhibitions
89
                         router-link(to="/exhibition") &nbsp; Exhibitions
88
                     li 
90
                     li 
89
                         router-link(to="/event/sorted/by-current-and-upcoming") &nbsp; Events 
91
                         router-link(to="/event/sorted/by-current-and-upcoming") &nbsp; Events 
90
                     li
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
             li
94
             li
93
                 h5
95
                 h5
94
-                router-link(to="") Education 
95
-                ul.f-col.start
96
+                    router-link(to="") Education 
97
+                ul.f-col
96
                     li
98
                     li
97
                         router-link(to="/guide") &nbsp; Guides 
99
                         router-link(to="/guide") &nbsp; Guides 
98
                     li 
100
                     li 
99
                         router-link(to="/publication") &nbsp; Publications 
101
                         router-link(to="/publication") &nbsp; Publications 
102
+                    li 
103
+                        router-link(to="/page/library") &nbsp; Library 
100
 
104
 
101
 
105
 
102
             li
106
             li
103
                 h5
107
                 h5
104
-                router-link(to="") News
105
-                ul.f-col.start
108
+                    router-link(to="") News
109
+                ul.f-col
106
                     li
110
                     li
107
                         router-link(to="/blog") &nbsp; Blog Posts  
111
                         router-link(to="/blog") &nbsp; Blog Posts  
108
                     li 
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
                     li 
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
     .sub-footer.f-col.start
117
     .sub-footer.f-col.start
114
         h6 Craft in America &copy; 2010&ndash;{{ today }} 
118
         h6 Craft in America &copy; 2010&ndash;{{ today }} 
138
     footer.main
142
     footer.main
139
         display: flex
143
         display: flex
140
         flex-wrap: wrap
144
         flex-wrap: wrap
145
+        align-items: flex-start 
146
+
141
         min-width: $min-width
147
         min-width: $min-width
142
         /* background-color: $cia_red */
148
         /* background-color: $cia_red */
143
         // ALL <ul> tags
149
         // ALL <ul> tags
148
                 width: 100%
154
                 width: 100%
149
         // OUTER <ul> tags
155
         // OUTER <ul> tags
150
         > ul
156
         > ul
151
-            padding: 0 $ms-0
157
+            padding: $ms-0
152
             &:nth-child(n+2)
158
             &:nth-child(n+2)
153
-                padding: 0 $ms-0 $ms-3 $ms-0
159
+                /* padding: 0 $ms-0 $ms-3 $ms-0 */
154
             > li
160
             > li
155
                 color: $cia_white
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
                 a, a:link, a:visited
168
                 a, a:link, a:visited
161
                     color: $cia_white
169
                     color: $cia_white
162
                     text-decoration: none
170
                     text-decoration: none
208
             /* background-color: rebeccapurple */
216
             /* background-color: rebeccapurple */
209
             background-color: $cia_red
217
             background-color: $cia_red
210
             &:nth-child(n+2)
218
             &:nth-child(n+2)
211
-                margin: 0 0 $ms-2 0
219
+                /* margin: 0 0 $ms-2 0 */
212
                 > li
220
                 > li
213
                     width: 43%
221
                     width: 43%
214
     /* 1200px */
222
     /* 1200px */

+ 1
- 1
vue-theme/src/components/navigation/navigation.vue Целия файл

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

+ 71
- 22
vue-theme/src/components/sidebars/sidebar.vue Целия файл

5
         .shadow(v-if="shouldShowListSort.includes(type) && layout !== 'single'")
5
         .shadow(v-if="shouldShowListSort.includes(type) && layout !== 'single'")
6
             h3.t-up sort {{ type }}
6
             h3.t-up sort {{ type }}
7
             ul.t-up
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
                 li(v-for="option in sortOptions")
21
                 li(v-for="option in sortOptions")
9
                     router-link(:to="`/${type}/sorted/${sortTypes[option]}`")
22
                     router-link(:to="`/${type}/sorted/${sortTypes[option]}`")
10
                         p {{ option }}
23
                         p {{ option }}
11
                 li
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
                         p by current and upcoming
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
         .shadow(v-if="shouldShowMaterialSort.includes(type) && layout !== 'single'")
32
         .shadow(v-if="shouldShowMaterialSort.includes(type) && layout !== 'single'")
20
             h3.t-up {{ type }} by material
33
             h3.t-up {{ type }} by material
21
             ul.t-up
34
             ul.t-up
24
                         router-link(:to="`/${type}/sorted/by-material#${material}`")
37
                         router-link(:to="`/${type}/sorted/by-material#${material}`")
25
                             p {{ material }}
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
         .shadow(v-if="['artist'].includes(type) && layout !== 'single'")
41
         .shadow(v-if="['artist'].includes(type) && layout !== 'single'")
29
             h3.t-up {{ type }} alpha 
42
             h3.t-up {{ type }} alpha 
30
             ul.t-up
43
             ul.t-up
31
-                li
44
+                li.f-row.start.wrap
32
                     template(v-for="charaSet in charaSets") 
45
                     template(v-for="charaSet in charaSets") 
33
                         router-link(:to="`/${type}/sorted/by-alpha#${charaSet[0]}`")
46
                         router-link(:to="`/${type}/sorted/by-alpha#${charaSet[0]}`")
34
-                            p {{ charaSet }}
47
+                            p.alpha {{ charaSet }}
35
 
48
 
36
         //- p2p types and related posts
49
         //- p2p types and related posts
37
         .shadow(v-if="layout === 'single' && Object.keys(related).length" v-for="p2pPostType in Object.keys(related)")
50
         .shadow(v-if="layout === 'single' && Object.keys(related).length" v-for="p2pPostType in Object.keys(related)")
85
     data() {
98
     data() {
86
         return {
99
         return {
87
             sortTypes: {
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
             charaSets: [
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
             materials: materials,
116
             materials: materials,
99
             shouldShowListSort: [
117
             shouldShowListSort: [
102
                 'publication', 'technique', 'post'
120
                 'publication', 'technique', 'post'
103
             ],
121
             ],
104
             shouldShowMaterialSort: [
122
             shouldShowMaterialSort: [
105
-                'artist', 
123
+                'artist', 'exhibition', 'event',
106
                 'short', 'guide', 'object',
124
                 'short', 'guide', 'object',
107
                 'technique',
125
                 'technique',
108
             ],
126
             ],
114
             ],
132
             ],
115
             shouldShowTypeSort: [
133
             shouldShowTypeSort: [
116
                 'short', 'guide', 'object',
134
                 'short', 'guide', 'object',
117
-                'publication', 'technique', 'post'
135
+                'publication', 'technique', 'post', 'event'
118
             ]
136
             ]
119
         }
137
         }
120
     },
138
     },
127
                         Object.keys(this.sortTypes)[0],
145
                         Object.keys(this.sortTypes)[0],
128
                         Object.keys(this.sortTypes)[3],
146
                         Object.keys(this.sortTypes)[3],
129
                         Object.keys(this.sortTypes)[1],
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
                     break
163
                     break
133
                 case 'post':
164
                 case 'post':
134
                     opts = [
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
                     break
171
                     break
138
                 case 'short':
172
                 case 'short':
176
 @import '../../sss/theme.sss'
210
 @import '../../sss/theme.sss'
177
 aside.sidebar
211
 aside.sidebar
178
     /* need to solve for mobile as the sticky creates scroll issues */
212
     /* need to solve for mobile as the sticky creates scroll issues */
179
-    /* position: sticky */
213
+    position: sticky
180
     top: 40px
214
     top: 40px
181
     width: 100%
215
     width: 100%
182
     p, h3
216
     p, h3
187
         > *
221
         > *
188
             padding: $ms-0
222
             padding: $ms-0
189
             margin: 0 0 $ms-0 0
223
             margin: 0 0 $ms-0 0
224
+            display: table-cell
190
         > .post
225
         > .post
191
             /* background-color: blue */
226
             /* background-color: blue */
192
     ul
227
     ul
195
         flex-direction: column
230
         flex-direction: column
196
         flex-wrap: wrap 
231
         flex-wrap: wrap 
197
         li
232
         li
198
-            padding: 0 0 $ms-0 0
233
+            /* padding: 0 0 $ms-0 0 */
199
             img
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
     .shadow
240
     .shadow
202
         background-color: white
241
         background-color: white
203
 
242
 
243
+
204
 /* width larger than $medium  */
244
 /* width larger than $medium  */
205
 @media (min-width: $medium)
245
 @media (min-width: $medium)
206
     aside.sidebar
246
     aside.sidebar
247
+        position: sticky
207
         min-width: 25%
248
         min-width: 25%
208
         width: 25%
249
         width: 25%
250
+        > section 
251
+            > * 
252
+                display: inherit 
209
         ul
253
         ul
210
             flex-direction: column
254
             flex-direction: column
255
+            li 
256
+                img
257
+                    display: block  
258
+                    width: 100%
259
+
211
 </style>
260
 </style>

+ 137
- 70
vue-theme/src/pages/list.vue Целия файл

4
 
4
 
5
         header.center.t-up
5
         header.center.t-up
6
             .title.f-row
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
                 h3(v-else) Search results for: {{$route.query.s }}&nbsp;
9
                 h3(v-else) Search results for: {{$route.query.s }}&nbsp;
9
                 span(v-if="sortBy")
10
                 span(v-if="sortBy")
10
                     h3 {{ sortBy.replace('-', ' ') }}
11
                     h3 {{ sortBy.replace('-', ' ') }}
58
     },
59
     },
59
     computed: {
60
     computed: {
60
         type() {
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
         sortBy() {
72
         sortBy() {
64
             return this.$route.params.sortBy
73
             return this.$route.params.sortBy
76
             return !sansSidebarTypes.includes(this.type)
85
             return !sansSidebarTypes.includes(this.type)
77
         },
86
         },
78
         pType() {
87
         pType() {
79
-            if(!this.type) return
88
+            if (!this.type) return
80
             return `${convertTitleCase(this.type)}s`
89
             return `${convertTitleCase(this.type)}s`
81
         },
90
         },
82
         loaded() {
91
         loaded() {
83
             if (!this.pType) return
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
         posts() {
97
         posts() {
87
             if (!this.pType) return
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
         shouldLoadAllAtOnce() {
103
         shouldLoadAllAtOnce() {
91
-            return this.type == 'episode' ||
104
+            return (
105
+                this.type == 'episode' ||
92
                 this.sortBy == sortTypes.subtype ||
106
                 this.sortBy == sortTypes.subtype ||
93
                 this.sortBy == sortTypes.material ||
107
                 this.sortBy == sortTypes.material ||
94
                 this.sortBy == sortTypes.episode
108
                 this.sortBy == sortTypes.episode
95
-        }
109
+            )
110
+        },
96
     },
111
     },
97
     methods: {
112
     methods: {
98
         async loadMoreSearchResults() {
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
             const getPosts = async params => {
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
             try {
121
             try {
104
                 this.loadingFetched = true
122
                 this.loadingFetched = true
105
                 this.page++
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
                 this.loadingFetched = false
129
                 this.loadingFetched = false
114
                 // Stop trying to load more posts
130
                 // Stop trying to load more posts
115
-                if(res && !res.length) {
131
+                if (res && !res.length) {
116
                     this.keepFetching = false
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
         async loadMorePosts(shouldClear) {
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
                 console.log(`Getting more ${this.type} posts`)
149
                 console.log(`Getting more ${this.type} posts`)
127
                 // We always grab all pages on hero init so no need to do it here
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
                 this.$store.commit(`CLEAR_${this.pType.toUpperCase()}`)
160
                 this.$store.commit(`CLEAR_${this.pType.toUpperCase()}`)
136
-                
161
+
137
                 // Clear any state needed to track title inbetweens
162
                 // Clear any state needed to track title inbetweens
138
                 const hasInbetweens = ['artist']
163
                 const hasInbetweens = ['artist']
139
-                if(hasInbetweens.includes(this.type)) {
164
+                if (hasInbetweens.includes(this.type)) {
140
                     this.$store.commit(`CLEAR_${this.pType.toUpperCase()}_SEEN`)
165
                     this.$store.commit(`CLEAR_${this.pType.toUpperCase()}_SEEN`)
141
                 }
166
                 }
142
             }
167
             }
144
             try {
169
             try {
145
                 this.loadingFetched = true
170
                 this.loadingFetched = true
146
                 this.page++
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
                 const res = await getPosts(
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
                 this.loadingFetched = false
184
                 this.loadingFetched = false
156
 
185
 
157
                 // Stop trying to load more posts
186
                 // Stop trying to load more posts
158
-                if(res && !res.length || this.shouldLoadAllAtOnce) {
187
+                if ((res && !res.length) || this.shouldLoadAllAtOnce) {
159
                     this.keepFetching = false
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
         async getPage(type) {
204
         async getPage(type) {
166
             await this._getAllIfNotLoaded('page', this.$store)
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
             const page = this.allPages.filter(page => page.slug == `${type}`)[0]
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
             return page
209
             return page
171
         },
210
         },
172
         // _setHeroInfo(post) {} from mixin
211
         // _setHeroInfo(post) {} from mixin
173
         // _clearHero(store) {} from mixin
212
         // _clearHero(store) {} from mixin
174
         async checkAndSetHero(type) {
213
         async checkAndSetHero(type) {
214
+            // console.log('hero type :', type)
175
             this._clearHero(this.$store)
215
             this._clearHero(this.$store)
176
             try {
216
             try {
177
                 const page = await this.getPage(type)
217
                 const page = await this.getPage(type)
178
                 // We always set a hero no matter what
218
                 // We always set a hero no matter what
179
                 // Because the hero component will deal
219
                 // Because the hero component will deal
180
                 // with how to render based on hero.url
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
         setIntersectionLoader(cb) {
229
         setIntersectionLoader(cb) {
185
             // KeepFetching is UNSET for certain post types and sort types in `loadMorePosts()`
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
             // Always unset before setting the intersection loader
236
             // Always unset before setting the intersection loader
189
             this.unsetIntersectionLoader()
237
             this.unsetIntersectionLoader()
190
 
238
 
191
             // console.warn('Setting interesection loader...')
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
             this.observer.observe(document.querySelector(INTERSECT_SELECTOR))
249
             this.observer.observe(document.querySelector(INTERSECT_SELECTOR))
199
         },
250
         },
200
         unsetIntersectionLoader() {
251
         unsetIntersectionLoader() {
201
             const footerEl = document.querySelector(INTERSECT_SELECTOR)
252
             const footerEl = document.querySelector(INTERSECT_SELECTOR)
202
             try {
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
                 this.observer.unobserve(footerEl)
257
                 this.observer.unobserve(footerEl)
206
                 this.observer.disconnect()
258
                 this.observer.disconnect()
207
-            } catch (error) { console.error(error) }
259
+            } catch (error) {
260
+                console.error(error)
261
+            }
208
         },
262
         },
209
         initPostList() {
263
         initPostList() {
210
             this.page = 0
264
             this.page = 0
211
             this.keepFetching = true
265
             this.keepFetching = true
212
 
266
 
213
-            if(this.isSearch) {
267
+            if (this.isSearch) {
214
                 this.checkAndSetHero(`search`)
268
                 this.checkAndSetHero(`search`)
215
                 this.$store.commit(`CLEAR_SEARCH_RESULTS`)
269
                 this.$store.commit(`CLEAR_SEARCH_RESULTS`)
216
                 this.loadMoreSearchResults()
270
                 this.loadMoreSearchResults()
222
                 this.loadMorePosts(true)
276
                 this.loadMorePosts(true)
223
                 this.setIntersectionLoader(this.loadMorePosts)
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
     watch: {
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
         // This only fires navigating from a list page, to another list page
297
         // This only fires navigating from a list page, to another list page
237
         type(newType) {
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
             // Ignore some types with presorts so the sortBy watcher can handle them
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
             this.initPostList()
311
             this.initPostList()
244
         },
312
         },
245
         // Fires when navigating between pages with different sorts
313
         // Fires when navigating between pages with different sorts
246
         sortBy(newSort) {
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
             this.initPostList()
316
             this.initPostList()
250
         },
317
         },
251
     },
318
     },
255
     },
322
     },
256
     beforeUnmount() {
323
     beforeUnmount() {
257
         this.unsetIntersectionLoader()
324
         this.unsetIntersectionLoader()
258
-    }
325
+    },
259
 }
326
 }
260
 </script>
327
 </script>
261
 
328
 

+ 1
- 2
vue-theme/src/pages/mixin-post-types.js Целия файл

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

+ 11
- 3
vue-theme/src/pages/single.vue Целия файл

248
         background-color: white
248
         background-color: white
249
         padding: $ms-0
249
         padding: $ms-0
250
         h1
250
         h1
251
-            color: $cia_black
251
+            /* color: $cia_black */
252
             margin: 0 0 $ms--3 0
252
             margin: 0 0 $ms--3 0
253
         > ul
253
         > ul
254
             /* grid-gap: $ms-0 */
254
             /* grid-gap: $ms-0 */
270
                 position: absolute
270
                 position: absolute
271
                 top: 100%
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
         /* iframe container 16:9 */
283
         /* iframe container 16:9 */
274
         [class^="iframe-container"]
284
         [class^="iframe-container"]
275
             position: relative
285
             position: relative
291
             margin: $ms-2 auto
301
             margin: $ms-2 auto
292
             &.is-style
302
             &.is-style
293
                 &-default
303
                 &-default
294
-                    height: 1px
295
                     width: 15vw
304
                     width: 15vw
296
                 &-wide
305
                 &-wide
297
-                    height: 3px
298
                     width: 50vw
306
                     width: 50vw
299
                 &-dots::before
307
                 &-dots::before
300
                     outline-style: none
308
                     outline-style: none

+ 2
- 2
vue-theme/src/sss/_typography.sss Целия файл

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

+ 20
- 21
vue-theme/src/sss/variables.sss Целия файл

15
 $max-card-img-height: 420px
15
 $max-card-img-height: 420px
16
 $card-line-clamp: 3
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
 /* Fonts */
39
 /* Fonts */
41
 $sans: 'Questrial', sans-serif
40
 $sans: 'Questrial', sans-serif

+ 1
- 1
vue-theme/src/store/index.js Целия файл

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

+ 4
- 1
vue-theme/src/utils/api.js Целия файл

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

+ 6
- 11
vue-theme/src/utils/helpers.js Целия файл

3
     return type.charAt(0).toUpperCase() + type.slice(1)
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
 const sortTypes = {
8
 const sortTypes = {
16
     alpha: 'by-alpha',
9
     alpha: 'by-alpha',
17
-    recent: 'by-recent',
18
     material: 'by-material',
10
     material: 'by-material',
19
     artist: 'by-artist',
11
     artist: 'by-artist',
20
     episode: 'by-episode',
12
     episode: 'by-episode',
21
     upcoming: 'by-upcoming',
13
     upcoming: 'by-upcoming',
22
     current: 'by-current',
14
     current: 'by-current',
23
     subtype: 'by-type',
15
     subtype: 'by-type',
16
+    date: 'by-date',
24
     currentAndUpcoming: 'by-current-and-upcoming',
17
     currentAndUpcoming: 'by-current-and-upcoming',
25
     past: 'by-past',
18
     past: 'by-past',
26
 }
19
 }
81
 
74
 
82
 const formatDate = (unix, includeTime) => {
75
 const formatDate = (unix, includeTime) => {
83
     const d = new Date(parseInt(unix) * 1000)
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
 export {
82
 export {
90
     sortTypes,
85
     sortTypes,
91
     postTypes,
86
     postTypes,
92
     ytThumbnail,
87
     ytThumbnail,
93
-    formatDate
88
+    formatDate,
94
 }
89
 }

Loading…
Отказ
Запис