Prechádzať zdrojové kódy

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

Benjamin Tissoires 7 rokov pred
rodič
commit
e57269ed57

+ 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();