浏览代码

UI: lists: only output the number of cards for each swimlane

Benjamin Tissoires 7 年之前
父节点
当前提交
e57269ed57
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 1 1
      client/components/lists/listHeader.jade
  2. 10 0
      client/components/lists/listHeader.js

+ 1 - 1
client/components/lists/listHeader.jade

@@ -16,7 +16,7 @@ template(name="listHeader")
 
         if showCardsCountForList cards.count
           | 
-          p.quiet.small {{cards.count}} {{_ 'cards-count'}}
+          p.quiet.small {{cardsCount}} {{_ 'cards-count'}}
       if isMiniScreen
         if currentList
           if isWatching

+ 10 - 0
client/components/lists/listHeader.js

@@ -22,6 +22,16 @@ BlazeComponent.extendComponent({
     return Meteor.user().getLimitToShowCardsCount();
   },
 
+  cardsCount() {
+    const list = Template.currentData();
+    let swimlaneId = '';
+    const boardView = Meteor.user().profile.boardView;
+    if (boardView === 'board-view-swimlanes')
+      swimlaneId = this.parentComponent().parentComponent().data()._id;
+
+    return list.cards(swimlaneId).count();
+  },
+
   reachedWipLimit() {
     const list = Template.currentData();
     return list.getWipLimit('enabled') && list.getWipLimit('value') <= list.cards().count();