summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoramadilsons <joao.amado.95@gmail.com>2017-10-09 14:49:03 +0200
committeramadilsons <joao.amado.95@gmail.com>2017-10-09 14:49:03 +0200
commit6ba1fc5ba1901a8cd8d7e8eb86e9ce70789d62e2 (patch)
treed519ed3f1780982795b2485fb39419c8e2d18bef
parentc84187bdadb7f1afaa8211773d1d1cb986709099 (diff)
downloadwekan-6ba1fc5ba1901a8cd8d7e8eb86e9ce70789d62e2.tar.gz
wekan-6ba1fc5ba1901a8cd8d7e8eb86e9ce70789d62e2.tar.bz2
wekan-6ba1fc5ba1901a8cd8d7e8eb86e9ce70789d62e2.zip
user can now leave the board
-rw-r--r--client/components/sidebar/sidebar.jade18
-rw-r--r--client/components/sidebar/sidebar.js16
-rw-r--r--i18n/en-GB.i18n.json4
-rw-r--r--i18n/en.i18n.json2
-rw-r--r--i18n/pt-BR.i18n.json4
5 files changed, 29 insertions, 15 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();
diff --git a/i18n/en-GB.i18n.json b/i18n/en-GB.i18n.json
index 2c18438d..2d7ff4b0 100644
--- a/i18n/en-GB.i18n.json
+++ b/i18n/en-GB.i18n.json
@@ -243,6 +243,8 @@
"language": "Language",
"last-admin-desc": "You can’t change roles because there must be at least one admin.",
"leave-board": "Leave Board",
+ "leave-board-pop": "Are you sure you want to leave __boardTitle__? You will be removed from all cards on this board.",
+ "leaveBoardPopup-title": "Leave Board ?",
"link-card": "Link to this card",
"list-archive-cards": "Archive all cards in this list",
"list-archive-cards-pop": "This will remove all the cards in this list from the board. To view archived cards and bring them back to the board, click “Menu” > “Archived Items”.",
@@ -395,4 +397,4 @@
"no": "No",
"accounts": "Accounts",
"accounts-allowEmailChange": "Allow Email Change"
-} \ No newline at end of file
+}
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 95be9865..1df8d9ca 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -243,6 +243,8 @@
"language": "Language",
"last-admin-desc": "You can’t change roles because there must be at least one admin.",
"leave-board": "Leave Board",
+ "leave-board-pop": "Are you sure you want to leave __boardTitle__? You will be removed from all cards on this board.",
+ "leaveBoardPopup-title": "Leave Board ?",
"link-card": "Link to this card",
"list-archive-cards": "Archive all cards in this list",
"list-archive-cards-pop": "This will remove all the cards in this list from the board. To view archived cards and bring them back to the board, click “Menu” > “Archived Items”.",
diff --git a/i18n/pt-BR.i18n.json b/i18n/pt-BR.i18n.json
index ccb2bbe6..7e46bd7b 100644
--- a/i18n/pt-BR.i18n.json
+++ b/i18n/pt-BR.i18n.json
@@ -243,6 +243,8 @@
"language": "Idioma",
"last-admin-desc": "Você não pode alterar funções porque deve existir pelo menos um administrador.",
"leave-board": "Sair do Quadro",
+ "leave-board-pop": "Tem a certeza de que pretende sair de __boardTitle__? Você será removido de todos os cartões neste quadro. ",
+ "leaveBoardPopup-title": "Sair do Quadro ?",
"link-card": "Vincular a este cartão",
"list-archive-cards": "Arquivar todos os cartões nesta lista",
"list-archive-cards-pop": "Isto removerá todos os cartões desta lista do quadro. Para visualizar os cartões arquivados e trazê-los de volta para o quadro, clique em “Menu” > “Itens Arquivados”.",
@@ -395,4 +397,4 @@
"no": "Não",
"accounts": "Contas",
"accounts-allowEmailChange": "Permitir Mudança de Email"
-} \ No newline at end of file
+}