mirror of
https://github.com/wekan/wekan.git
synced 2025-04-24 05:57:13 -04:00
user can now leave the board
This commit is contained in:
parent
c84187bdad
commit
6ba1fc5ba1
5 changed files with 29 additions and 15 deletions
|
@ -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")
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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”.",
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue