summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
authorLiming Xie <liming.xie@gmail.com>2016-01-05 23:26:02 +0800
committerLiming Xie <liming.xie@gmail.com>2016-01-05 23:26:02 +0800
commit9bbdacc79a89667e0d6f1ed30c415e5350ad468b (patch)
treefc6d9918dcd77699295ecb5bdbaf59f9d7c2f479 /client/components/cards
parent9ef8ebaf09e52d7133ebe08ab1354ef663ee948b (diff)
downloadwekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.gz
wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.tar.bz2
wekan-9bbdacc79a89667e0d6f1ed30c415e5350ad468b.zip
Add notification, allow watch boards / lists / cards
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/cardDetails.jade5
-rw-r--r--client/components/cards/cardDetails.js18
-rw-r--r--client/components/cards/cardDetails.styl5
3 files changed, 28 insertions, 0 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 3f2ae34a..2ca032ef 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -10,6 +10,8 @@ template(name="cardDetails")
h2.card-details-title.js-card-title(
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
= title
+ if isWatching
+ i.fa.fa-eye.card-details-watch
if archived
p.warning {{_ 'card-archived'}}
@@ -83,6 +85,9 @@ template(name="editCardTitleForm")
template(name="cardDetailsActionsPopup")
ul.pop-over-list
+ li: a.js-toggle-watch-card {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}}
+ hr
+ ul.pop-over-list
li: a.js-members {{_ 'card-edit-members'}}
li: a.js-labels {{_ 'card-edit-labels'}}
li: a.js-attachments {{_ 'card-edit-attachments'}}
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 2b04adad..d8323393 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -23,6 +23,11 @@ BlazeComponent.extendComponent({
this.calculateNextPeak();
},
+ isWatching() {
+ const card = this.currentData();
+ return card.findWatcher(Meteor.userId());
+ },
+
scrollParentContainer() {
const cardPanelWidth = 510;
const bodyBoardComponent = this.parentComponent();
@@ -128,6 +133,12 @@ BlazeComponent.extendComponent({
}
}).register('inlinedCardDescription');
+Template.cardDetailsActionsPopup.helpers({
+ isWatching() {
+ return this.findWatcher(Meteor.userId());
+ },
+});
+
Template.cardDetailsActionsPopup.events({
'click .js-members': Popup.open('cardMembers'),
'click .js-labels': Popup.open('cardLabels'),
@@ -139,6 +150,13 @@ Template.cardDetailsActionsPopup.events({
Popup.close();
},
'click .js-more': Popup.open('cardMore'),
+ 'click .js-toggle-watch-card'() {
+ const currentCard = this;
+ const level = currentCard.findWatcher(Meteor.userId()) ? null : 'watching';
+ Meteor.call('watch', 'card', currentCard._id, level, (err, ret) => {
+ if (!err && ret) Popup.close();
+ });
+ },
});
Template.editCardTitleForm.onRendered(function() {
diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl
index 4ac0578b..d7d29551 100644
--- a/client/components/cards/cardDetails.styl
+++ b/client/components/cards/cardDetails.styl
@@ -36,6 +36,11 @@
font-size: 17px
padding: 10px
+ .card-details-watch
+ font-size: 17px
+ padding-left: 7px
+ color: #a6a6a6
+
.card-details-title
font-weight: bold
font-size: 1.33em