summaryrefslogtreecommitdiffstats
path: root/client/components/boards
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2016-01-06 12:49:58 +0100
committerMaxime Quandalle <maxime@quandalle.com>2016-01-06 12:49:58 +0100
commit1e8368dea53977292a8f49d3bef9032ab068627b (patch)
treeac7f3f4be8db0c024012b0707b3e8f7b9ceb2b86 /client/components/boards
parent61e6e71f294f2a6117e53d5e0a4597b7bf9d80de (diff)
parent39e1cc02374b3a379de87bdcb95a7a343b698a05 (diff)
downloadwekan-1e8368dea53977292a8f49d3bef9032ab068627b.tar.gz
wekan-1e8368dea53977292a8f49d3bef9032ab068627b.tar.bz2
wekan-1e8368dea53977292a8f49d3bef9032ab068627b.zip
Merge pull request #454 from floatinghotpot/notification
Add notifications, allow watch boards / lists / cards
Diffstat (limited to 'client/components/boards')
-rw-r--r--client/components/boards/boardHeader.jade49
-rw-r--r--client/components/boards/boardHeader.js28
2 files changed, 77 insertions, 0 deletions
diff --git a/client/components/boards/boardHeader.jade b/client/components/boards/boardHeader.jade
index fe6b56e6..ce8999c3 100644
--- a/client/components/boards/boardHeader.jade
+++ b/client/components/boards/boardHeader.jade
@@ -19,6 +19,17 @@ template(name="boardHeaderBar")
i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
span {{_ currentBoard.permission}}
+ a.board-header-btn.js-watch-board
+ if $eq watchLevel "watching"
+ i.fa.fa-eye
+ span {{_ 'watching'}}
+ if $eq watchLevel "tracking"
+ i.fa.fa-user
+ span {{_ 'tracking'}}
+ if $eq watchLevel "muted"
+ i.fa.fa-times-circle
+ span {{_ 'muted'}}
+
.board-header-btns.right
if isMiniScreen
unless isSandstorm
@@ -34,6 +45,17 @@ template(name="boardHeaderBar")
i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
span {{_ currentBoard.permission}}
+ a.board-header-btn.js-watch-board
+ if $eq watchLevel "watching"
+ i.fa.fa-eye
+ span {{_ 'watching'}}
+ if $eq watchLevel "tracking"
+ i.fa.fa-user
+ span {{_ 'tracking'}}
+ if $eq watchLevel "muted"
+ i.fa.fa-times-circle
+ span {{_ 'muted'}}
+
a.board-header-btn.js-open-filter-view(
title="{{#if Filter.isActive}}{{_ 'filter-on-desc'}}{{/if}}"
class="{{#if Filter.isActive}}emphasis{{/if}}")
@@ -97,6 +119,33 @@ template(name="boardVisibilityList")
template(name="boardChangeVisibilityPopup")
+boardVisibilityList
+template(name="boardChangeWatchPopup")
+ ul.pop-over-list
+ li
+ with "watching"
+ a.js-select-watch
+ i.fa.fa-eye.colorful
+ | {{_ 'watching'}}
+ if watchCheck
+ i.fa.fa-check
+ span.sub-name {{_ 'watching-info'}}
+ li
+ with "tracking"
+ a.js-select-watch
+ i.fa.fa-user.colorful
+ | {{_ 'tracking'}}
+ if watchCheck
+ i.fa.fa-check
+ span.sub-name {{_ 'tracking-info'}}
+ li
+ with "muted"
+ a.js-select-watch
+ i.fa.fa-times-circle.colorful
+ | {{_ 'muted'}}
+ if watchCheck
+ i.fa.fa-check
+ span.sub-name {{_ 'muted-info'}}
+
template(name="boardChangeColorPopup")
.board-backgrounds-list.clearfix
each backgroundColors
diff --git a/client/components/boards/boardHeader.js b/client/components/boards/boardHeader.js
index fb19d9c6..055b6f27 100644
--- a/client/components/boards/boardHeader.js
+++ b/client/components/boards/boardHeader.js
@@ -41,6 +41,11 @@ Template.boardChangeTitlePopup.events({
});
BlazeComponent.extendComponent({
+ watchLevel() {
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ return currentBoard.getWatchLevel(Meteor.userId());
+ },
+
isStarred() {
const boardId = Session.get('currentBoard');
const user = Meteor.user();
@@ -65,6 +70,7 @@ BlazeComponent.extendComponent({
},
'click .js-open-board-menu': Popup.open('boardMenu'),
'click .js-change-visibility': Popup.open('boardChangeVisibility'),
+ 'click .js-watch-board': Popup.open('boardChangeWatch'),
'click .js-open-filter-view'() {
Sidebar.setView('filter');
},
@@ -176,3 +182,25 @@ BlazeComponent.extendComponent({
}];
},
}).register('boardChangeVisibilityPopup');
+
+BlazeComponent.extendComponent({
+ watchLevel() {
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ return currentBoard.getWatchLevel(Meteor.userId());
+ },
+
+ watchCheck() {
+ return this.currentData() === this.watchLevel();
+ },
+
+ events() {
+ return [{
+ 'click .js-select-watch'() {
+ const level = this.currentData();
+ Meteor.call('watch', 'board', Session.get('currentBoard'), level, (err, ret) => {
+ if (!err && ret) Popup.close();
+ });
+ },
+ }];
+ },
+}).register('boardChangeWatchPopup');