Sfoglia il codice sorgente

:recycle: making sidebar state easier to read

tags/1.0.0
J 4 anni fa
parent
commit
d09eaede5d

+ 27
- 8
vue-theme/src/components/sidebars/sidebar.vue Vedi File

@@ -63,7 +63,7 @@ import relatedSidebar from './related'
63 63
 import exhibitionsSidebar from './exhibitions'
64 64
 import eventsSidebar from './events'
65 65
 
66
-import { sortTypes } from '@/utils/helpers'
66
+import { sortTypes, materials } from '@/utils/helpers'
67 67
 
68 68
 export default {
69 69
     props: {
@@ -88,13 +88,32 @@ export default {
88 88
                 'by artist': `${sortTypes.artist}`,       //:2
89 89
                 'by episode': `${sortTypes.episode}`,     //:3
90 90
             },
91
-            charaSets: ['0 a b', 'c d e', 'f g h', 'i j k', 'l m n', 'o p q', 'r s t', 'u v w', 'x y z'],
92
-            materials: ['clay', 'fiber', 'glass', 'metal', 'paper', 'wood'],
93
-            shouldShowListSort: ['artist', 'exhibition', 'event', 'short', 'guide', 'object', 'publication', 'technique', 'post'],
94
-            shouldShowMaterialSort: ['artist', 'technique', 'short', 'object', 'guide'],
95
-            shouldShowAlphaSort: ['artist'],
96
-            shouldShowDateSort: ['exhibition', 'event'],
97
-            shouldShowTypeSort: ['short', 'guide', 'publication', 'technique', 'object', 'post']
91
+            charaSets: [
92
+                '0 a b', 'c d e', 'f g h',
93
+                'i j k', 'l m n', 'o p q',
94
+                'r s t', 'u v w', 'x y z'
95
+            ],
96
+            materials: materials,
97
+            shouldShowListSort: [
98
+                'artist', 'exhibition', 'event', 
99
+                'short', 'guide', 'object',
100
+                'publication', 'technique', 'post'
101
+            ],
102
+            shouldShowMaterialSort: [
103
+                'artist', 
104
+                'short', 'guide', 'object',
105
+                'technique',
106
+            ],
107
+            shouldShowAlphaSort: [
108
+                'artist'
109
+            ],
110
+            shouldShowDateSort: [
111
+                'exhibition', 'event'
112
+            ],
113
+            shouldShowTypeSort: [
114
+                'short', 'guide', 'object',
115
+                'publication', 'technique', 'post'
116
+            ]
98 117
         }
99 118
     },
100 119
     computed: {

+ 10
- 0
vue-theme/src/utils/helpers.js Vedi File

@@ -3,6 +3,15 @@ const convertTitleCase = type => {
3 3
     return type.charAt(0).toUpperCase() + type.slice(1)
4 4
 }
5 5
 
6
+const materials = [
7
+    'clay',
8
+    'fiber',
9
+    'glass',
10
+    'metal',
11
+    'paper',
12
+    'wood'
13
+]
14
+
6 15
 const sortTypes = {
7 16
     alpha: 'by-alpha',
8 17
     recent: 'by-recent',
@@ -77,6 +86,7 @@ const formatDate = (unix, includeTime) => {
77 86
 
78 87
 export {
79 88
     convertTitleCase,
89
+    materials,
80 90
     sortTypes,
81 91
     postTypes,
82 92
     ytThumbnail,

Loading…
Annulla
Salva