浏览代码

:recycle: forcing exhibition current and upcoming only

tags/0.9.0
j 4 年前
父节点
当前提交
950468adb0
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 1
    2
      vue-theme/src/pages/list.vue
  2. 7
    0
      vue-theme/src/store/modules/exhibition.js

+ 1
- 2
vue-theme/src/pages/list.vue 查看文件

@@ -13,8 +13,7 @@
13 13
 
14 14
         .posts(v-if="posts && loaded" :class="{ 'is-grid': grid }")
15 15
             section(v-for="(post, i) in posts" :key="post.slug").shadow.post
16
-                p {{ post }}
17
-            //-     card(:content="post" :type="type" :wide="type == 'exhibitions' && i > 1 || type == 'events' && i > 1 ")
16
+                card(:content="post" :type="type" :wide="type == 'exhibitions' && i > 1 || type == 'events' && i > 1 ")
18 17
 
19 18
         footer
20 19
             p {{ `${type} count: ${Object.values(posts).length}` }}

+ 7
- 0
vue-theme/src/store/modules/exhibition.js 查看文件

@@ -16,6 +16,13 @@ const actions = {
16 16
     getAllExhibitions({ commit }, sortType) {
17 17
         commit('CLEAR_EXHIBITIONS')
18 18
         commit('EXHIBITIONS_LOADED', false)
19
+
20
+        // Forcing sort because 90% of the time
21
+        // we only care about current and upcoming
22
+        if (sortType == 'exhibitions') {
23
+            sortType = sortTypes.currentAndUpcoming
24
+        }
25
+
19 26
         return api.getByType('exhibitions', sortType, exhibitions => {
20 27
             commit('STORE_FETCHED_EXHIBITIONS', { exhibitions })
21 28
             commit('EXHIBITIONS_LOADED', true)

正在加载...
取消
保存