summaryrefslogtreecommitdiffstats
path: root/client/components/cards/helpers.js
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-12 13:59:39 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-12 17:48:15 +0200
commitc8945679872a0708eb67a477a99a65d508c84cb0 (patch)
tree5cf9f2cc842f891451f7bc247b5f0833c1ab39e7 /client/components/cards/helpers.js
parent216887490e3be0ba141484afc11d37475e91562d (diff)
downloadwekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.gz
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.tar.bz2
wekan-c8945679872a0708eb67a477a99a65d508c84cb0.zip
Work on the card activities and comments
This commit also introduces a new CSSEvents object that is used to abstract vendor specifics events related to CSS transitions and animations. Fixes #183. Fixes #179.
Diffstat (limited to 'client/components/cards/helpers.js')
-rw-r--r--client/components/cards/helpers.js48
1 files changed, 0 insertions, 48 deletions
diff --git a/client/components/cards/helpers.js b/client/components/cards/helpers.js
deleted file mode 100644
index ce85002d..00000000
--- a/client/components/cards/helpers.js
+++ /dev/null
@@ -1,48 +0,0 @@
-Template.cardMembersPopup.helpers({
- isCardMember: function() {
- var cardId = Template.parentData()._id;
- var cardMembers = Cards.findOne(cardId).members || [];
- return _.contains(cardMembers, this.userId);
- },
- user: function() {
- return Users.findOne(this.userId);
- }
-});
-
-Template.cardLabelsPopup.helpers({
- isLabelSelected: function(cardId) {
- return _.contains(Cards.findOne(cardId).labelIds, this._id);
- }
-});
-
-var labelColors;
-Meteor.startup(function() {
- labelColors = Boards.simpleSchema()._schema['labels.$.color'].allowedValues;
-});
-
-Template.createLabelPopup.helpers({
- // This is the default color for a new label. We search the first color that
- // is not already used in the board (although it's not a problem if two
- // labels have the same color).
- defaultColor: function() {
- var labels = this.labels || this.card.board().labels;
- var usedColors = _.pluck(labels, 'color');
- var availableColors = _.difference(labelColors, usedColors);
- return availableColors.length > 1 ? availableColors[0] : labelColors[0];
- }
-});
-
-Template.formLabel.helpers({
- labels: function() {
- return _.map(labelColors, function(color) {
- return { color: color, name: '' };
- });
- }
-});
-
-Blaze.registerHelper('currentCard', function() {
- var cardId = Session.get('currentCard');
- if (cardId) {
- return Cards.findOne(cardId);
- }
-});