summaryrefslogtreecommitdiffstats
path: root/client/components/users
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/users
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/users')
-rw-r--r--client/components/users/userHeader.jade18
-rw-r--r--client/components/users/userHeader.js20
2 files changed, 38 insertions, 0 deletions
diff --git a/client/components/users/userHeader.jade b/client/components/users/userHeader.jade
index 8e988c8e..cae768fb 100644
--- a/client/components/users/userHeader.jade
+++ b/client/components/users/userHeader.jade
@@ -15,6 +15,7 @@ template(name="memberMenuPopup")
li: a.js-change-avatar {{_ 'edit-avatar'}}
li: a.js-change-password {{_ 'changePasswordPopup-title'}}
li: a.js-change-language {{_ 'changeLanguagePopup-title'}}
+ li: a.js-edit-notification {{_ 'editNotificationPopup-title'}}
hr
ul.pop-over-list
li: a.js-logout {{_ 'log-out'}}
@@ -32,6 +33,23 @@ template(name="editProfilePopup")
input.js-profile-initials(type="text" value=profile.initials)
input.primary.wide(type="submit" value="{{_ 'save'}}")
+template(name="editNotificationPopup")
+ ul.pop-over-list
+ li
+ a.js-toggle-tag-notify-watch
+ i.fa.fa-eye.colorful
+ | {{_ 'watching'}}
+ if hasTag "notify-watch"
+ i.fa.fa-check
+ span.sub-name {{_ 'notify-watch'}}
+ li
+ a.js-toggle-tag-notify-participate
+ i.fa.fa-user.colorful
+ | {{_ 'tracking'}}
+ if hasTag "notify-participate"
+ i.fa.fa-check
+ span.sub-name {{_ 'notify-participate'}}
+
template(name="changePasswordPopup")
+atForm(state='changePwd')
diff --git a/client/components/users/userHeader.js b/client/components/users/userHeader.js
index a478da0c..10fdf699 100644
--- a/client/components/users/userHeader.js
+++ b/client/components/users/userHeader.js
@@ -8,6 +8,7 @@ Template.memberMenuPopup.events({
'click .js-change-avatar': Popup.open('changeAvatar'),
'click .js-change-password': Popup.open('changePassword'),
'click .js-change-language': Popup.open('changeLanguage'),
+ 'click .js-edit-notification': Popup.open('editNotification'),
'click .js-logout'(evt) {
evt.preventDefault();
@@ -33,6 +34,25 @@ Template.editProfilePopup.events({
},
});
+Template.editNotificationPopup.helpers({
+ hasTag(tag) {
+ const user = Meteor.user();
+ return user && user.hasTag(tag);
+ },
+});
+
+// we defined github like rules, see: https://github.com/settings/notifications
+Template.editNotificationPopup.events({
+ 'click .js-toggle-tag-notify-participate'() {
+ const user = Meteor.user();
+ if (user) user.toggleTag('notify-participate');
+ },
+ 'click .js-toggle-tag-notify-watch'() {
+ const user = Meteor.user();
+ if (user) user.toggleTag('notify-watch');
+ },
+});
+
// XXX For some reason the useraccounts autofocus isnt working in this case.
// See https://github.com/meteor-useraccounts/core/issues/384
Template.changePasswordPopup.onRendered(function() {