summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
Diffstat (limited to 'client/components')
-rw-r--r--client/components/sidebar/sidebar.jade18
-rw-r--r--client/components/sidebar/sidebar.js16
2 files changed, 21 insertions, 13 deletions
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 6045b371..6085c2ad 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -82,23 +82,27 @@ template(name="memberPopup")
ul.pop-over-list
li
a.js-filter-member {{_ 'filter-cards'}}
- if currentUser.isBoardAdmin
- unless isSandstorm
+ unless isSandstorm
+ if currentUser.isBoardAdmin
li
a.js-change-role
| {{_ 'change-permissions'}}
span.quiet (#{memberType})
- li
- if $eq currentUser._id userId
- a.js-leave-member {{_ 'leave-board'}}
- else
- a.js-remove-member {{_ 'remove-from-board'}}
+ li
+ if $eq currentUser._id userId
+ a.js-leave-member {{_ 'leave-board'}}
+ else if currentUser.isBoardAdmin
+ a.js-remove-member {{_ 'remove-from-board'}}
template(name="removeMemberPopup")
p {{_ 'remove-member-pop' name=user.profile.fullname username=user.username boardTitle=board.title}}
button.js-confirm.negate.full(type="submit") {{_ 'remove-member'}}
+template(name="leaveBoardPopup")
+ p {{_ 'leave-board-pop' boardTitle=board.title}}
+ button.js-confirm.negate.full(type="submit") {{_ 'leave-board'}}
+
template(name="addMemberPopup")
.js-search-member
+esInput(index="users")
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 1290fd13..f4f0c118 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -153,15 +153,13 @@ Template.memberPopup.events({
Boards.findOne(boardId).removeMember(memberId);
Popup.close();
}),
- 'click .js-leave-member'() {
+ 'click .js-leave-member': Popup.afterConfirm('leaveBoard', () => {
const boardId = Session.get('currentBoard');
Meteor.call('quitBoard', boardId, (err, ret) => {
- if (!ret && ret) {
- Popup.close();
- FlowRouter.go('home');
- }
+ Popup.close();
+ FlowRouter.go('home');
});
- },
+ }),
});
Template.removeMemberPopup.helpers({
@@ -173,6 +171,12 @@ Template.removeMemberPopup.helpers({
},
});
+Template.leaveBoardPopup.helpers({
+ board() {
+ return Boards.findOne(Session.get('currentBoard'));
+ },
+});
+
Template.membersWidget.helpers({
isInvited() {
const user = Meteor.user();