Add notification, allow watch boards / lists / cards

This commit is contained in:
Liming Xie 2016-01-05 23:26:02 +08:00
parent 9ef8ebaf09
commit 9bbdacc79a
24 changed files with 579 additions and 16 deletions

View file

@ -65,6 +65,10 @@
text-overflow: ellipsis
word-wrap: break-word
.list-header-watch-icon
padding-left: 10px
color: #a6a6a6
.list-header-menu-icon
position: absolute
padding: 7px

View file

@ -7,6 +7,8 @@ template(name="listHeader")
class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
= title
if currentUser.isBoardMember
if isWatching
i.list-header-watch-icon.fa.fa-eye
a.list-header-menu-icon.fa.fa-navicon.js-open-list-menu
template(name="editListTitleForm")
@ -17,6 +19,9 @@ template(name="editListTitleForm")
a.fa.fa-times-thin.js-close-inlined-form
template(name="listActionPopup")
ul.pop-over-list
li: a.js-toggle-watch-list {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}}
hr
ul.pop-over-list
li: a.js-add-card {{_ 'add-card'}}
if cards.count

View file

@ -8,6 +8,11 @@ BlazeComponent.extendComponent({
}
},
isWatching() {
const list = this.currentData();
return list.findWatcher(Meteor.userId());
},
events() {
return [{
'click .js-open-list-menu': Popup.open('listAction'),
@ -16,6 +21,12 @@ BlazeComponent.extendComponent({
},
}).register('listHeader');
Template.listActionPopup.helpers({
isWatching() {
return this.findWatcher(Meteor.userId());
},
});
Template.listActionPopup.events({
'click .js-add-card'() {
const listDom = document.getElementById(`js-list-${this._id}`);
@ -29,6 +40,13 @@ Template.listActionPopup.events({
MultiSelection.add(cardIds);
Popup.close();
},
'click .js-toggle-watch-list'() {
const currentList = this;
const level = currentList.findWatcher(Meteor.userId()) ? null : 'watching';
Meteor.call('watch', 'list', currentList._id, level, (err, ret) => {
if (!err && ret) Popup.close();
});
},
'click .js-close-list'(evt) {
evt.preventDefault();
this.archive();