Pārlūkot izejas kodu

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

tags/1.0.2
maeda 3 gadus atpakaļ
vecāks
revīzija
568cbb9898

+ 57
- 56
.drone.yml Parādīt failu

@@ -5,7 +5,6 @@
5 5
 
6 6
 # push_deploy_key: id_rsa from DRONE host machine
7 7
 
8
-
9 8
 ################
10 9
 # Build & Test #
11 10
 ################
@@ -14,43 +13,43 @@ kind: pipeline
14 13
 name: run_tests
15 14
 
16 15
 steps:
17
-# Test the vue theme
18
-- name: test
19
-  image: node
20
-  commands:
21
-  - pwd
22
-  - cd ./vue-theme
23
-  - npm install
24
-  - npm test
25
-  volumes:
26
-  # Link node_modules cache from host filesystem into container at the expected location
27
-  - name: node_cache
28
-    path: /drone/src/vue-theme/node_modules
16
+    # Test the vue theme
17
+    - name: test
18
+      image: node
19
+      commands:
20
+          - pwd
21
+          - cd ./vue-theme
22
+          - npm install
23
+          - npm test
24
+      volumes:
25
+          # Link node_modules cache from host filesystem into container at the expected location
26
+          - name: node_cache
27
+            path: /drone/src/vue-theme/node_modules
29 28
 
30
-- name: build
31
-  image: node
32
-  commands:
33
-  - cd ./vue-theme
34
-  - rm -Rf ./build/*
35
-  - npx browserslist@latest --update-db
36
-  - npm run build
37
-  - ls ./build
38
-  environment:
39
-    NODE_OPTIONS: --openssl-legacy-provider
40
-  volumes:
41
-    # Link node_modules cache from host filesystem into container at the expected location
42
-    - name: node_cache
43
-      path: /drone/src/vue-theme/node_modules
44 29
     - name: build
45
-      path: /drone/src/vue-theme/build
30
+      image: node
31
+      commands:
32
+          - cd ./vue-theme
33
+          - rm -Rf ./build/*
34
+          - npx browserslist@latest --update-db
35
+          - npm run build
36
+          - ls ./build
37
+      environment:
38
+          NODE_OPTIONS: --openssl-legacy-provider
39
+      volumes:
40
+          # Link node_modules cache from host filesystem into container at the expected location
41
+          - name: node_cache
42
+            path: /drone/src/vue-theme/node_modules
43
+          - name: build
44
+            path: /drone/src/vue-theme/build
46 45
 
47 46
 volumes:
48
-  - name: node_cache
49
-    host:
50
-      path: /tmp/cache/drone/node_modules
51
-  - name: build
52
-    host:
53
-      path: /tmp/cache/drone/build
47
+    - name: node_cache
48
+      host:
49
+          path: /tmp/cache/drone/node_modules
50
+    - name: build
51
+      host:
52
+          path: /tmp/cache/drone/build
54 53
 ---
55 54
 ########################
56 55
 # Deploy to Production #
@@ -59,30 +58,32 @@ volumes:
59 58
 kind: pipeline
60 59
 name: deploy
61 60
 depends_on:
62
-  # Must run after the first pipeline
63
-  - run_tests
61
+    # Must run after the first pipeline
62
+    - run_tests
64 63
 trigger:
65
-  status:
66
-    # Only runs if the first pipeline was fully successful
67
-    - success
64
+    status:
65
+        # Only runs if the first pipeline was fully successful
66
+        - success
67
+    branch:
68
+        - master
68 69
 
69 70
 steps:
70
-# post-receive hook
71
-- name: push commit
72
-  image: appleboy/drone-git-push:0.2.0-linux-amd64
73
-  settings:
74
-    branch: master
75
-    remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
76
-    remote_name: staging
77
-    force: true
78
-    ssh_key:
79
-      # !: id_rsa from DRONE machine
80
-      from_secret: push_deploy_key
71
+    # post-receive hook
72
+    - name: push commit
73
+      image: appleboy/drone-git-push:0.2.0-linux-amd64
74
+      settings:
75
+          branch: master
76
+          remote: maeda@143.110.234.41:/opt/staging/vue-wp.git
77
+          remote_name: staging
78
+          force: true
79
+          ssh_key:
80
+              # !: id_rsa from DRONE machine
81
+              from_secret: push_deploy_key
81 82
 
82 83
 volumes:
83
-  - name: node_cache
84
-    host:
85
-      path: /tmp/cache/drone/node_modules
86
-  - name: build
87
-    host:
88
-      path: /tmp/cache/drone/build
84
+    - name: node_cache
85
+      host:
86
+          path: /tmp/cache/drone/node_modules
87
+    - name: build
88
+      host:
89
+          path: /tmp/cache/drone/build

+ 7
- 0
plugins/cia-endpoints/cia-end-points.php Parādīt failu

@@ -17,6 +17,7 @@
17 17
 if ( ! defined( 'WPINC' ) ) { die; }
18 18
 
19 19
 require_once('includes/all-types.php');
20
+require_once('includes/class.make-oneofeach.php');
20 21
 require_once('includes/class.make-endpoint.php');
21 22
 require_once('includes/class.make-terms.php');
22 23
 require_once('includes/class.make-sticky.php');
@@ -53,6 +54,12 @@ add_action( 'rest_api_init', function () {
53 54
     $sticky_controller = new Make_Sticky_Endpoint();
54 55
     $sticky_controller->register_custom_route('sticky');
55 56
     
57
+    /**
58
+     * OneEach endpoint
59
+     */
60
+    $oneeach_controller = new Make_One_Each_Endpoint();
61
+    $oneeach_controller->register_custom_route('oneofeach');
62
+    
56 63
     /**
57 64
      * Terms endpoint
58 65
      */

+ 63
- 0
plugins/cia-endpoints/includes/class.make-oneofeach.php Parādīt failu

@@ -0,0 +1,63 @@
1
+<?php
2
+// include('formats.php');
3
+
4
+class Make_One_Each_Endpoint extends WP_REST_Controller {
5
+    /**
6
+     * Register the routes for the objects of the controller.
7
+     */
8
+    public function register_custom_route($route) {
9
+        $version = '2';
10
+        $namespace = 'craft/v' . $version;
11
+
12
+        register_rest_route( $namespace, '/' . $route, [
13
+            array(
14
+                'methods'  => WP_REST_Server::READABLE,
15
+                'callback' => array( $this, 'get_all_items' )
16
+            ),
17
+        ]);
18
+    }
19
+    public function get_all_items( $request ) {
20
+        $args = array(
21
+            'numberposts' => 1,
22
+        );
23
+
24
+        return new WP_REST_Response( $this->prepare_all_items_for_response($args), 200 );
25
+    }
26
+    public function prepare_all_items_for_response( $args ) {
27
+        $collection = array();
28
+        $types = [
29
+            'artist',
30
+            'episode',
31
+            'event',
32
+            'exhibition',
33
+            'guide',
34
+            'object',
35
+            'publication',
36
+            'technique',
37
+            'short',
38
+            'post',
39
+        ];
40
+
41
+        $q = [];
42
+        foreach($types as $post_type) {
43
+            array_push($q, new WP_Query(array(
44
+                'numberposts' => 1,
45
+                'post_type' => $post_type,
46
+                'post_status' => ['publish'],
47
+            )));
48
+            array_push($q, $post_type);
49
+            
50
+            $found_post = $q[0]->get_posts();
51
+
52
+            $formatted = default_post_format( $found_post, false );
53
+            $formatted['tried'] = $q[1];
54
+            array_push($collection, $formatted);
55
+        }
56
+        wp_reset_postdata();
57
+
58
+        return $collection;
59
+        // return $types;
60
+    }
61
+}
62
+
63
+?>

+ 8
- 3
plugins/cia-endpoints/includes/reformat-blocks.php Parādīt failu

@@ -3,13 +3,13 @@
3 3
         $parsed_blocks = array();
4 4
         foreach ($blocks as $block) {
5 5
             if($block[blockName] === "core/gallery") {
6
+                // Fix for new style gallery blocks
6 7
                 if(count($block[attrs][ids]) < 1) {
7 8
                     $gallery_imgs_ids = [];
8 9
                     foreach($block[innerBlocks] as $inner) {
9 10
                         $inner_id = $inner[attrs][id];
10 11
                         array_push($gallery_imgs_ids, $inner_id);
11 12
                     }
12
-                    $block[attrs]['zzz'] = $gallery_imgs_ids;
13 13
                     $block[attrs][ids] = $gallery_imgs_ids;
14 14
                 } 
15 15
                 array_push($parsed_blocks, $block[attrs]);
@@ -34,11 +34,16 @@
34 34
 
35 35
         foreach ($images as $image) {
36 36
             if($image->getAttribute('data-id')) {
37
-                $parse_images[$image->getAttribute('data-id')] = $image->getAttribute('src');
37
+                $id = $image->getAttribute('data-id');
38 38
             } else {
39 39
                 $class_pieces = explode("-", $image->getAttribute('class'));
40
-                $parse_images[end($class_pieces)] = $image->getAttribute('src');
40
+                $id = end($class_pieces);
41 41
             }
42
+            // Format for lightbox wants an object
43
+            $parse_images[$id] = [
44
+                'src' => $image->getAttribute('src'),
45
+                'title' => $image->getAttribute('alt'),
46
+            ];
42 47
         }
43 48
         return $parse_images;
44 49
     }

+ 8
- 7
plugins/cia-post-types/includes/p2p-mappings.php Parādīt failu

@@ -20,15 +20,16 @@ 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', 'publication']);
24
-    register_connections_for('artist', ['artist', 'object', 'technique', 'publication']);
25
-    register_connections_for('short', ['short', 'exhibition', 'event', 'object', 'guide', 'post', 'technique', 'publication']);
23
+    register_connections_for('post', ['post', 'publication']);
24
+    register_connections_for('artist', ['artist', 'object', 'technique', 'post', 'publication']);
25
+    register_connections_for('exhibition', ['exhibition','technique', 'post', 'publication']);
26
+    register_connections_for('event', ['event', 'object', 'guide', 'technique', 'post', 'publication']);
27
+    register_connections_for('episode', ['episode', 'object', 'guide', 'technique', 'post', 'publication']);
28
+    register_connections_for('short', ['short', 'exhibition', 'event', 'object', 'guide', 'technique', 'post', 'publication']);
26 29
     register_connections_for('technique', ['technique', 'post', 'publication']);
27 30
     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
+    register_connections_for('object', ['object', 'exhibition', 'guide', 'technique', 'post', 'publication']);
32
+    register_connections_for('publication', ['publication']);
32 33
 }
33 34
 
34 35
 function all_connection_types() {

+ 5
- 0
vue-theme/editor-style.css Parādīt failu

@@ -125,5 +125,10 @@ hr .wp-block-separator, .is-style-dots:before {
125 125
     position: inherit !important;
126 126
     background: none !important;
127 127
     color: black !important;
128
+    max-height: 5% !important;
129
+    overflow: visible !important;
130
+    padding: 0 !important;
131
+    margin-bottom: 0.75em !important;
132
+
128 133
 }
129 134
 

+ 17
- 0
vue-theme/functions.php Parādīt failu

@@ -387,3 +387,20 @@ function custom_publication_column( $column, $post_id ) {
387 387
             break;
388 388
     }
389 389
 }
390
+// Add Author to Custom Post Type
391
+function add_author_support_to_posts() {
392
+    $args = array(
393
+       'public'   => true,
394
+       '_builtin' => false
395
+    );
396
+
397
+    $output = 'names';
398
+
399
+    $post_types = get_post_types( $args, $output ); 
400
+
401
+    foreach ( $post_types  as $post_type ) {
402
+        add_post_type_support( $post_type, 'author' );
403
+    }
404
+
405
+}
406
+add_action( 'init', 'add_author_support_to_posts' );

+ 10
- 0
vue-theme/index.php Parādīt failu

@@ -1,10 +1,20 @@
1 1
 <!DOCTYPE html>
2 2
 <html <?php language_attributes(); ?>>
3 3
     <head>
4
+        <!-- Google tag (gtag.js) -->
5
+        <script async src="https://www.googletagmanager.com/gtag/js?id=AW-10996061145"></script>
6
+        <script>
7
+        window.dataLayer = window.dataLayer || [];
8
+        function gtag(){dataLayer.push(arguments);}
9
+        gtag('js', new Date());
10
+
11
+        gtag('config', 'AW-10996061145');
12
+        </script>
4 13
         <title><?php wp_title(); ?></title>
5 14
         <meta charset="<?php bloginfo( 'charset' ); ?>">
6 15
         <meta name="viewport" content="width=device-width, initial-scale=1">
7 16
         <link rel="prefetch" url="resource-url" />
17
+
8 18
         <?php wp_head(); ?>
9 19
     </head>
10 20
     <body>

Binārs
vue-theme/screenshot.png Parādīt failu


+ 1
- 1
vue-theme/src/app.vue Parādīt failu

@@ -36,7 +36,7 @@ html
36 36
             /* background-color: green*/
37 37
             background-color: $cia_white2
38 38
             width: 100%
39
-            padding: 0 0 3vh 0
39
+            padding: 0 0 1vh 0
40 40
             
41 41
             /* :--headings, a */
42 42
             a

+ 21
- 12
vue-theme/src/components/navigation/navigation.vue Parādīt failu

@@ -19,7 +19,8 @@ nav.main.w-max
19 19
 
20 20
             //- hardcoded menu
21 21
             li.f-grow
22
-            li.t-up PBS Series 
22
+            li.t-up
23
+                router-link(to="/episode") PBS Series
23 24
                 ul.submenu 
24 25
                     li
25 26
                         router-link(to="/episode") Episodes
@@ -28,23 +29,26 @@ nav.main.w-max
28 29
                     li
29 30
                         router-link(to="/technique") Techniques
30 31
             li.f-grow
31
-            li.t-up Artists
32
+            li.t-up
33
+                router-link(to="/artist/sorted/by-material") Artists
32 34
                 ul.submenu
33 35
                     li
34 36
                         router-link(to="/artist/sorted/by-alpha") A - Z
35 37
                     li
36 38
                         router-link(to="/artist/sorted/by-material") By Material
37 39
             li.f-grow
38
-            li.t-up Exhibitions
40
+            li.t-up 
41
+                router-link(to="/exhibition/sorted/by-current-and-upcoming") Exhibitions
39 42
                 ul.submenu 
40 43
                     li
41 44
                         router-link(to="/exhibition/sorted/by-current-and-upcoming") Current/Upcoming
42 45
                     li
43
-                        router-link(to="/exhibition/sorted/by-date") Past
46
+                        router-link(to="/exhibition/sorted/by-past") Past
44 47
                     li
45 48
                         router-link(to="/object") Explore Craft Objects
46 49
             li.f-grow
47
-            li.t-up Center 
50
+            li.t-up  
51
+                router-link(to="/page/center") Center
48 52
                 ul.submenu 
49 53
                     li
50 54
                         router-link(to="/page/center") Info
@@ -55,7 +59,8 @@ nav.main.w-max
55 59
                     li
56 60
                         router-link(to="/page/library") Library
57 61
             li.f-grow
58
-            li.t-up Education  
62
+            li.t-up   
63
+                router-link(to="/guide") Education
59 64
                 ul.submenu 
60 65
                     li
61 66
                         router-link(to="/guide") Education Guides
@@ -71,7 +76,8 @@ nav.main.w-max
71 76
                         router-link(to="/page/library") Library
72 77
                     
73 78
             li.f-grow
74
-            li.t-up Resources   
79
+            li.t-up    
80
+                router-link(to="/page/artists-resources") Resources
75 81
                 ul.submenu 
76 82
                     li
77 83
                         router-link(to="/page/artists-resources") Opportunities
@@ -82,14 +88,16 @@ nav.main.w-max
82 88
                     li
83 89
                         router-link(to="/page/community-craft-calendar") Community Craft Calendar 
84 90
             li.f-grow
85
-            li.t-up Support   
91
+            li.t-up    
92
+                router-link(to="/page/donate") Support
86 93
                 ul.submenu 
87 94
                     li
88 95
                         router-link(to="/page/donate") Donate
89 96
                     li
90 97
                         router-link(to="/page/shop") Shop 
91 98
             li.f-grow
92
-            li.t-up About    
99
+            li.t-up    
100
+                router-link(to="/page/about") About 
93 101
                 ul.submenu 
94 102
                     li
95 103
                         router-link(to="/page/about") Craft in America 
@@ -103,11 +111,11 @@ nav.main.w-max
103 111
                         router-link(to="/page/contact") Contact 
104 112
             li.f-grow
105 113
             li.t-up 
106
-                a(@click="toggleSearch") search
114
+                a(@click="toggleSearch") 🔍 
107 115
         ul(v-if="isSearchOpen").search.w-max
108 116
             li.f-row.w-max
109 117
                 input(v-model="searchTerms" @keyup.enter="sendSearch" tabindex="10")
110
-                button.b-none.bg-none(@click="sendSearch" tabindex="11") 🔍
118
+                button.b-none.bg-none(@click="sendSearch" tabindex="11") 🔍 search
111 119
 
112 120
     .mobile-menu
113 121
         .f-row.start
@@ -164,7 +172,7 @@ export default {
164 172
                 // 'education',
165 173
                 // 'resources',
166 174
                 // 'support',
167
-                // 'about',
175
+                'page/about',
168 176
                 '🔍'
169 177
             ]
170 178
             const ignore = [
@@ -261,6 +269,7 @@ nav.main
261 269
                 background-color: $lighter
262 270
                 padding: 0 0.5em 0.5em
263 271
                 opacity: 0
272
+                top: 23px
264 273
 
265 274
                 //- submenu hover
266 275
                 &:hover 

+ 49
- 13
vue-theme/src/components/sidebars/sidebar.vue Parādīt failu

@@ -6,17 +6,30 @@ aside.sidebar
6 6
             h3.t-up sort {{ type }}
7 7
             ul.t-up
8 8
                 li 
9
-                    //- ?type=articles //
9
+                    //- post?type=articles //
10 10
                     router-link(v-if="type === 'post' " :to="`/${type}?type=articles`")
11 11
                         p in the news
12 12
                 li 
13
-                    //- ?type=releases //
13
+                    //- post?type=releases //
14 14
                     router-link(v-if="type === 'post' " :to="`/${type}?type=releases`")
15 15
                         p press releases 
16 16
                 li 
17
-                    //- ?type=talks //
17
+                    //- event?type=concerts //
18
+                    router-link(v-if="type === 'event' " :to="`/${type}?type=concerts`")
19
+                        p concerts 
20
+                li 
21
+                    //- event?type=openings //
22
+                    router-link(v-if="type === 'event' " :to="`/${type}?type=openings`")
23
+                        p openings 
24
+                li 
25
+                    //- event?type=talks //
18 26
                     router-link(v-if="type === 'event' " :to="`/${type}?type=talks`")
19 27
                         p talks 
28
+                li 
29
+                    //- event?type=workshops //
30
+                    router-link(v-if="type === 'event' " :to="`/${type}?type=workshops`")
31
+                        p workshops 
32
+
20 33
                     //- by type //
21 34
                 li(v-for="option in sortOptions")
22 35
                     router-link(:to="`/${type}/sorted/${sortTypes[option]}`")
@@ -24,9 +37,10 @@ aside.sidebar
24 37
                 li
25 38
                     router-link(v-if="shouldShowDateSort.includes(type) " :to="`/${type}/sorted/by-current-and-upcoming`")
26 39
                         p by current and upcoming
27
-                li
28
-                    router-link(:to="`/${type}/sorted/by-date`")
29
-                        p by all
40
+                //- li
41
+                //-     router-link(v-if="type === ('event', 'exhibition') " :to="`/${type}/sorted/by-past`")
42
+                //-         p by past 
43
+
30 44
         
31 45
         //- if {{type}} has sorted by-material show material options
32 46
         .shadow(v-if="shouldShowMaterialSort.includes(type) && layout !== 'single'")
@@ -46,6 +60,15 @@ aside.sidebar
46 60
                         router-link(:to="`/${type}/sorted/by-alpha#${charaSet[0]}`")
47 61
                             p.alpha {{ charaSet }}
48 62
 
63
+        //- if type has sorted by-episode show episode options           
64
+        .shadow(v-if="shouldShowEpisodeSort.includes(type) && layout !== 'single'")
65
+            h3.t-up {{ type }} episode  
66
+            ul.t-up
67
+                li.f-row.start.wrap
68
+                    template(v-for="episodeSet in episodeSets") 
69
+                        router-link(:to="`/${type}/sorted/by-episode#${episodeSet}`")
70
+                            p {{ episodeSet }}&nbsp;&nbsp;
71
+
49 72
         //- p2p types and related posts
50 73
         .shadow(v-if="layout === 'single' && Object.keys(related).length" v-for="p2pPostType in Object.keys(related)")
51 74
             related-sidebar(:posts-by-type="related" :post-type="p2pPostType")
@@ -103,16 +126,20 @@ export default {
103 126
                 'by artist': `${sortTypes.artist}`,     //:2
104 127
                 'by episode': `${sortTypes.episode}`,   //:3
105 128
                 'by type': `${sortTypes.subtype}`,      //:4
106
-                // 'by articles': `articles`,              //:5
129
+                'by past': `${sortTypes.past}`,         //:5
130
+                // 'by articles': `articles`,           
107 131
                 subtype: 'by-type',
108 132
             },
109 133
             charaSets: [
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 134
                 '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 
114 135
                 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
115 136
             ],
137
+            episodeSets: [
138
+                'inspiration', 'home', 'jewelery', 'harmony', 'storytellers', 
139
+                'democracy', 'identity', 'quilts', 'visionaries', 'california', 
140
+                'neighbors', 'borders', 'nature', 'teachers', 'music', 
141
+                'celebration', 'service', 'industry', 'holiday', 'forge',
142
+            ],
116 143
             materials: materials,
117 144
             shouldShowListSort: [
118 145
                 'artist', 'exhibition', 'event', 
@@ -120,9 +147,14 @@ export default {
120 147
                 'publication', 'technique', 'post'
121 148
             ],
122 149
             shouldShowMaterialSort: [
123
-                'artist', 'exhibition', 'event',
124
-                'short', 'guide', 'object',
125
-                'technique',
150
+                'artist',
151
+                'short', 'guide',
152
+                'technique', 'publication',
153
+            ],
154
+            shouldShowEpisodeSort: [
155
+                'artist',
156
+                'short', 'guide',
157
+                'technique'
126 158
             ],
127 159
             shouldShowAlphaSort: [
128 160
                 'artist'
@@ -153,12 +185,14 @@ export default {
153 185
                     opts = [
154 186
                         // Object.keys(this.sortTypes)[4],
155 187
                         // Object.keys(this.sortTypes)[1],
188
+                        Object.keys(this.sortTypes)[5],
156 189
                     ]
157 190
                     break
158 191
                 case 'event':
159 192
                     opts = [
160 193
                         // Object.keys(this.sortTypes)[4],
161 194
                         // Object.keys(this.sortTypes)[1],
195
+                        Object.keys(this.sortTypes)[5],
162 196
                     ]
163 197
                     break
164 198
                 case 'post':
@@ -213,6 +247,7 @@ aside.sidebar
213 247
     position: sticky
214 248
     top: 40px
215 249
     width: 100%
250
+    font-size: x-small
216 251
     p, h3
217 252
         margin: 0
218 253
         padding: 0 0 $ms--4 0
@@ -247,6 +282,7 @@ aside.sidebar
247 282
         position: sticky
248 283
         min-width: 25%
249 284
         width: 25%
285
+        font-size: revert
250 286
         > section 
251 287
             > * 
252 288
                 display: inherit 

+ 55
- 23
vue-theme/src/pages/index.vue Parādīt failu

@@ -59,33 +59,42 @@ export default {
59 59
             // Limit the amount of posts because we
60 60
             // only need the most recent
61 61
             const params = { limit: 1 }
62
-            
62
+
63 63
             // We try and fetch EVERYTHING except
64 64
             // for EVENTS and EXHIBITIONS
65 65
             if (['event', 'exhibition'].includes(type)) {
66 66
                 // Only grab the current or upcoming on load
67
-                const eventsOrExhibitions = await this.$store.dispatch(
68
-                    action,
69
-                    { 
70
-                        sortType: sortTypes.currentAndUpcoming,
71
-                        params
72
-                    }
73
-                )
67
+                const eventsOrExhibitions = await this.$store.dispatch(action, {
68
+                    sortType: sortTypes.currentAndUpcoming,
69
+                    params,
70
+                })
74 71
                 // If no current or upcoming, get past events
75 72
                 // to fill in the blanks
76 73
                 if (eventsOrExhibitions.length < 1) {
77
-                    this.$store.dispatch(action, { sortType: sortTypes.past, params })
74
+                    this.$store.dispatch(action, {
75
+                        sortType: sortTypes.past,
76
+                        params,
77
+                    })
78 78
                 }
79
-            }
80
-            else if (!omit.includes(type)){
79
+            } else if (!omit.includes(type)) {
81 80
                 this.$store.dispatch(action, { sortType: null, params })
82 81
             }
83 82
         }
84 83
         if (!this['allPagesLoaded']) {
85
-            await this.$store.dispatch('getAllPages', { sortType: null, params: null })
84
+            await this.$store.dispatch('getAllPages', {
85
+                sortType: null,
86
+                params: null,
87
+            })
86 88
         }
87 89
         await this.checkAndSetHero('welcome')
88
-        await this.$store.dispatch('getRandomPosts', ['artist', 'guide', 'object', 'technique', 'publication', 'post'])
90
+        await this.$store.dispatch('getRandomPosts', [
91
+            'artist',
92
+            'guide',
93
+            'object',
94
+            'technique',
95
+            'publication',
96
+            'post',
97
+        ])
89 98
     },
90 99
     methods: {
91 100
         firstPostOfType(type) {
@@ -97,11 +106,9 @@ export default {
97 106
             // We always set a hero no matter what
98 107
             // Because the hero component will deal
99 108
             // with how to render based on hero.url
100
-            if(!this.allPages) return console.warn('no pages in state', this)
101
-            const page = this.allPages.filter(
102
-                page => page.slug == type,
103
-            )[0]
104
-            if(!page) return console.warn(`no page for ${type} found`)
109
+            if (!this.allPages) return console.warn('no pages in state', this)
110
+            const page = this.allPages.filter(page => page.slug == type)[0]
111
+            if (!page) return console.warn(`no page for ${type} found`)
105 112
 
106 113
             this.$store.commit('SET_HERO', this._setHeroInfo(page))
107 114
         },
@@ -131,12 +138,31 @@ export default {
131 138
                         max-height: $max-card-img-height
132 139
                     p.excerpt
133 140
                         -webkit-line-clamp: $card-line-clamp
141
+                &.flipped
142
+                    li 
143
+                        &:nth-of-type(4)
144
+                            /* p.excerpt, p.read-more
145
+                                display: none */
146
+                            header
147
+                                padding: 0.57em 0 
148
+                                a
149
+                                    display: none
134 150
             &.max 
135 151
                 > ul
136 152
                     grid-template-columns: 
137 153
                         auto
138 154
                     grid-template-rows: 
139 155
                         auto
156
+            &.stickies
157
+                ul
158
+                    &.flipped
159
+                        li
160
+                            &:nth-of-type(4)
161
+                                header
162
+                                    padding: 0 
163
+                                    a
164
+                                        display: block
165
+                
140 166
 /* min-width 768px */
141 167
 @media (min-width: $medium)
142 168
     .page--index 
@@ -146,7 +172,7 @@ export default {
146 172
                 ul
147 173
                     display: grid
148 174
                     grid-template-columns: 
149
-                        49.5% 24.25% 24.25%
175
+                        49.5% 24.35% 24.35%
150 176
                     grid-template-rows: repeat(2, 1fr)
151 177
                     gap: 0 $ms--2
152 178
                     li
@@ -178,7 +204,7 @@ export default {
178 204
                             grid-column-start: 3
179 205
                     &.flipped
180 206
                         grid-template-columns: 
181
-                            24.25% 24.25% 49.5% 
207
+                            24.35% 24.35% 49.5% 
182 208
                         li
183 209
                             &:nth-of-type(1)
184 210
                                 grid-row-end: 2
@@ -193,11 +219,12 @@ export default {
193 219
                         max-height: $max-card-img-height
194 220
                 &.stickies
195 221
                     .post 
196
-                        min-width: 24.25%
222
+                        min-width: 24.35%
223
+                        max-width: 33%
197 224
                     ul
198 225
                         &.flipped
199 226
                             grid-template-columns: 
200
-                                24.25% 24.25% 49.5% 
227
+                                24.35% 24.35% 49.5% 
201 228
                             li
202 229
                                 &:nth-of-type(1)
203 230
                                     grid-row-end: 2
@@ -207,6 +234,11 @@ export default {
207 234
                                 &:nth-of-type(5)
208 235
                                     grid-row-start: 1
209 236
                                     grid-row-end: 3
237
+                                &:nth-of-type(4)
238
+                                    header
239
+                                        padding: 0 
240
+                                        a
241
+                                            display: block
210 242
                         &[class^="sticky-"]
211 243
                             display: flex
212 244
                         &.sticky-1
@@ -216,7 +248,7 @@ export default {
216 248
                                     width: 100%
217 249
                         &.sticky-5
218 250
                             grid-template-columns: 
219
-                                24.25% 24.25% 49.5%
251
+                                24.35% 24.35% 49.5%
220 252
                             grid-template-rows: 
221 253
                                 repeat(2, 1fr)
222 254
                             gap: 3% 1%

+ 1
- 0
vue-theme/src/pages/mixin-post-types.js Parādīt failu

@@ -73,6 +73,7 @@ const heroUtils = {
73 73
                 post.type == 'page' && post.slug == 'staff' || 
74 74
                 post.type == 'page' && post.slug == 'board' || 
75 75
                 post.type == 'page' && post.slug == 'donate' || 
76
+                post.type == 'page' && post.slug == 'shop' || 
76 77
                 post.type == 'page' && post.slug == 'library' || 
77 78
                 post.type == 'page' && post.slug == 'artists-resources' || 
78 79
                 post.type == 'page' && post.slug == 'craft-resources-map' || 

+ 14
- 13
vue-theme/src/pages/single.vue Parādīt failu

@@ -202,7 +202,6 @@ export default {
202 202
             }
203 203
         },
204 204
         async singlePost(post) {
205
-            console.log('---')
206 205
             if (!this.$el) return
207 206
             const section = this.$el.children[0].querySelector('section')
208 207
             await nextTick()
@@ -215,18 +214,11 @@ export default {
215 214
                         const activeGallery =
216 215
                             post.galleries[this.activeGalleryIndex]
217 216
 
218
-                        console.log(post.galleries)
219
-                        console.log(activeGallery)
220
-
221 217
                         if (!activeGallery.ids) return
222 218
 
223 219
                         this.activeImageIndex = activeGallery.ids.indexOf(
224 220
                             parseInt(e.target.dataset.id),
225 221
                         )
226
-                        console.log(
227
-                            `opening gallery: ${this.activeGalleryIndex}.${this.activeImageIndex}`,
228
-                        )
229
-                        console.log(e.target.dataset)
230 222
                     })
231 223
                 })
232 224
             })
@@ -263,7 +255,7 @@ export default {
263 255
             position: relative
264 256
             width: 100% 
265 257
             padding-bottom: 56.25%
266
-            margin-bottom: 7em
258
+            margin-bottom: $ms-7
267 259
             &__wrapper
268 260
                 display: contents
269 261
             /* TBD if kept- edit ot test */
@@ -274,12 +266,18 @@ export default {
274 266
         .wp-block-gallery
275 267
             margin: 0 0 0.5em 0
276 268
             grid-gap: $ms--5
277
-            
278
-            > .wp-block-image     
269
+            > .wp-block-image  
279 270
                 figcaption
280 271
                     position: inherit
281 272
                     background: none
273
+                    font-size: $ms--1
282 274
                     color: $cia_black
275
+                    max-height: 9%
276
+                    overflow: visible 
277
+                    padding: 0 
278
+                    margin-bottom: 2.5em
279
+            figcaption
280
+                flex-direction: column
283 281
 
284 282
         /* iframe container 16:9 */
285 283
         [class^="iframe-container"]
@@ -339,6 +337,9 @@ export default {
339 337
             margin: 0 0.65em 0 0
340 338
         &.f-col
341 339
             flex-direction: row
342
-            .wp-block-embed, .is-type-video
343
-                margin-bottom: $ms-9
340
+            .wp-block-gallery
341
+                .wp-block-image  
342
+                    figcaption
343
+                        max-height: 5%
344
+                        margin-bottom: $ms-4            
344 345
 </style>

+ 22
- 7
vue-theme/src/sss/_lightbox.sss Parādīt failu

@@ -1,8 +1,11 @@
1
+@import './variables.sss'
2
+@import './theme.sss'
3
+
1 4
 .vel-fade
2 5
     &-enter-active, &-active
3 6
         transition: all 0.3s ease
4 7
     &-enter-from, &-leave-to
5
-        opacity: 0
8
+        opacity: 1
6 9
 
7 10
 .vel-img
8 11
     &-swiper
@@ -14,10 +17,10 @@
14 17
         position: absolute
15 18
         top: 50%
16 19
         transform: translate(-50% -50%)
17
-        transition: 0.3s linear
18
-        will-change: transform opacity
19
-    background-color: rgba(0, 0, 0, 0.7)
20
-    box-shadow: 0 5px 20px 2px rgba(0, 0, 0, 0.7)
20
+        /* transition: 0.3s linear */
21
+        /* will-change: transform opacity */
22
+    /* background-color: rgba(0, 0, 0, 0.7) */
23
+    box-shadow: 0.5px 0.5px 0.5px 0px rgb(0 0 0 / 30%)
21 24
     display: block
22 25
     max-height: 80vh
23 26
     max-width: 80vw
@@ -25,7 +28,7 @@
25 28
     transition: transform 0.3s ease-in-out
26 29
 
27 30
 .vel-modal
28
-    background: rgba(0, 0, 0, 0.5)
31
+    background: rgba(255, 255, 255, 0.9)
29 32
     bottom: 0
30 33
     left: 0
31 34
     margin: 0
@@ -33,13 +36,17 @@
33 36
     right: 0
34 37
     top: 0
35 38
     z-index: 10003
39
+    img
40
+        transition: none
41
+        &:hover
42
+            filter: grayscale(0%) brightness(100%)
36 43
 
37 44
 .vel-img, .vel-img-wrapper
38 45
     user-select: none
39 46
 
40 47
 .vel-btns-wrapper
41 48
     .btn__close, .btn__next, .btn__prev
42
-        color: #fff
49
+        color: $cia_black 
43 50
         cursor: pointer
44 51
         font-size: 32px
45 52
         opacity: 0.6
@@ -94,6 +101,7 @@
94 101
 
95 102
 .vel-modal.is-rtl .vel-img-title
96 103
     direction: rtl
104
+    display: block
97 105
 
98 106
 .vel-loading
99 107
     left: 50%
@@ -166,6 +174,7 @@
166 174
     width: 1em
167 175
 
168 176
 .vel-toolbar
177
+    display: none
169 178
     border-radius: 4px
170 179
     bottom: 8px
171 180
     display: flex
@@ -176,6 +185,7 @@
176 185
     position: absolute
177 186
     transform: translate(-50%)
178 187
     .toolbar-btn
188
+        display: none
179 189
         color: #fff
180 190
         cursor: pointer
181 191
         flex-shrink: 0
@@ -188,3 +198,8 @@
188 198
 .vel-toolbar, .vel-toolbar .toolbar-btn
189 199
     background-color: #2d2d2d
190 200
     user-select: none
201
+
202
+figcaption
203
+    position: inherit
204
+    background: none
205
+    color: $cia_black

+ 1
- 1
vue-theme/src/sss/variables.sss Parādīt failu

@@ -1,6 +1,6 @@
1 1
 @import './_ratios.sss'
2 2
 
3
-$transition: 500ms
3
+$transition: 300ms
4 4
 
5 5
 $min-width: 20em
6 6
 $max-width: 74em

+ 11
- 0
vue-theme/src/utils/api.js Parādīt failu

@@ -71,6 +71,17 @@ export default {
71 71
                 cb(e)
72 72
             })
73 73
     },
74
+    async getOneOfEach(types, cb, random = false) {
75
+        let posts = []
76
+        let get = `oneofeach?types=${types.split(',')}`
77
+        if (random) {
78
+            get = get + '&orderby=rand'
79
+        }
80
+        await axios.get(SETTINGS.API_BASE_PATH + get).then(response => {
81
+            posts = [...response.data]
82
+        })
83
+        cb(posts)
84
+    },
74 85
     async getRandom(types, cb) {
75 86
         let randomPosts = []
76 87
         for (let type of types) {

+ 1
- 1
vue-theme/src/utils/helpers.js Parādīt failu

@@ -75,7 +75,7 @@ const ytThumbnail = (url, desiredSize) => {
75 75
 const formatDate = (unix, includeTime) => {
76 76
     const d = new Date(parseInt(unix) * 1000)
77 77
     return includeTime
78
-        ? d.toLocaleString('en-US', { timeZone: 'UTC' })
78
+        ? d.toLocaleString('en-US', { timeZone: 'UTC', dateStyle: 'short', timeStyle: 'short' })
79 79
         : d.toLocaleDateString('en-US', { timeZone: 'UTC' })
80 80
 }
81 81
 

Notiek ielāde…
Atcelt
Saglabāt