From 2c0030da62b9a1e59a55e3429fe514bbd51e1ee3 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 29 May 2015 23:35:30 +0200 Subject: Implement multi-selection The UI and the internal APIs are still rough around the edges but the feature is basically working. You can now select multiple cards and move them together or (un|)assign them a label. --- collections/cards.js | 6 ++++++ collections/lists.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'collections') diff --git a/collections/cards.js b/collections/cards.js index 538b6af4..374dcbc3 100644 --- a/collections/cards.js +++ b/collections/cards.js @@ -120,9 +120,15 @@ Cards.helpers({ }); return cardLabels; }, + hasLabel: function(labelId) { + return _.contains(this.labelIds, labelId); + }, user: function() { return Users.findOne(this.userId); }, + isAssigned: function(memberId) { + return _.contains(this.members, memberId); + }, activities: function() { return Activities.find({ type: 'card', cardId: this._id }, { sort: { createdAt: -1 }}); diff --git a/collections/lists.js b/collections/lists.js index 196477ec..1a30dbba 100644 --- a/collections/lists.js +++ b/collections/lists.js @@ -44,7 +44,7 @@ if (Meteor.isServer) { Lists.helpers({ cards: function() { - return Cards.find(_.extend(Filter.getMongoSelector(), { + return Cards.find(Filter.mongoSelector({ listId: this._id, archived: false }), { sort: ['sort'] }); -- cgit v1.2.3-1-g7c22