mirror of
https://github.com/wekan/wekan.git
synced 2026-02-07 09:01:47 +01:00
Add Worker role.
Add more Font Awesome icons. Fix browser console errors when editing user profile name etc. Thanks to xet7 ! Closes #2788
This commit is contained in:
parent
0709b5abc8
commit
2bf004120d
37 changed files with 683 additions and 320 deletions
|
|
@ -112,12 +112,10 @@ BlazeComponent.extendComponent({
|
|||
currentUser = Meteor.user();
|
||||
if (currentUser) {
|
||||
Meteor.call('toggleMinicardLabelText');
|
||||
} else if (cookies.has('hiddenMinicardLabelText')) {
|
||||
cookies.remove('hiddenMinicardLabelText');
|
||||
} else {
|
||||
if (cookies.has('hiddenMinicardLabelText')) {
|
||||
cookies.remove('hiddenMinicardLabelText');
|
||||
} else {
|
||||
cookies.set('hiddenMinicardLabelText', 'true');
|
||||
}
|
||||
cookies.set('hiddenMinicardLabelText', 'true');
|
||||
}
|
||||
},
|
||||
'click .js-shortcuts'() {
|
||||
|
|
@ -135,12 +133,10 @@ Template.homeSidebar.helpers({
|
|||
currentUser = Meteor.user();
|
||||
if (currentUser) {
|
||||
return (currentUser.profile || {}).hiddenMinicardLabelText;
|
||||
} else if (cookies.has('hiddenMinicardLabelText')) {
|
||||
return true;
|
||||
} else {
|
||||
if (cookies.has('hiddenMinicardLabelText')) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -165,10 +161,13 @@ Template.memberPopup.helpers({
|
|||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
const commentOnly = currentBoard.hasCommentOnly(this.userId);
|
||||
const noComments = currentBoard.hasNoComments(this.userId);
|
||||
const worker = currentBoard.hasWorker(this.userId);
|
||||
if (commentOnly) {
|
||||
return TAPi18n.__('comment-only').toLowerCase();
|
||||
} else if (noComments) {
|
||||
return TAPi18n.__('no-comments').toLowerCase();
|
||||
} else if (worker) {
|
||||
return TAPi18n.__('worker').toLowerCase();
|
||||
} else {
|
||||
return TAPi18n.__(type).toLowerCase();
|
||||
}
|
||||
|
|
@ -271,6 +270,14 @@ Template.membersWidget.helpers({
|
|||
const user = Meteor.user();
|
||||
return user && user.isInvitedTo(Session.get('currentBoard'));
|
||||
},
|
||||
isWorker() {
|
||||
const user = Meteor.user();
|
||||
if (user) {
|
||||
return Meteor.call(Boards.hasWorker(user.memberId));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Template.membersWidget.events({
|
||||
|
|
@ -648,7 +655,7 @@ BlazeComponent.extendComponent({
|
|||
}).register('addMemberPopup');
|
||||
|
||||
Template.changePermissionsPopup.events({
|
||||
'click .js-set-admin, click .js-set-normal, click .js-set-no-comments, click .js-set-comment-only'(
|
||||
'click .js-set-admin, click .js-set-normal, click .js-set-no-comments, click .js-set-comment-only, click .js-set-worker'(
|
||||
event,
|
||||
) {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
|
|
@ -658,11 +665,13 @@ Template.changePermissionsPopup.events({
|
|||
'js-set-comment-only',
|
||||
);
|
||||
const isNoComments = $(event.currentTarget).hasClass('js-set-no-comments');
|
||||
const isWorker = $(event.currentTarget).hasClass('js-set-worker');
|
||||
currentBoard.setMemberPermission(
|
||||
memberId,
|
||||
isAdmin,
|
||||
isNoComments,
|
||||
isCommentOnly,
|
||||
isWorker,
|
||||
);
|
||||
Popup.back(1);
|
||||
},
|
||||
|
|
@ -679,7 +688,8 @@ Template.changePermissionsPopup.helpers({
|
|||
return (
|
||||
!currentBoard.hasAdmin(this.userId) &&
|
||||
!currentBoard.hasNoComments(this.userId) &&
|
||||
!currentBoard.hasCommentOnly(this.userId)
|
||||
!currentBoard.hasCommentOnly(this.userId) &&
|
||||
!currentBoard.hasWorker(this.userId)
|
||||
);
|
||||
},
|
||||
|
||||
|
|
@ -699,6 +709,13 @@ Template.changePermissionsPopup.helpers({
|
|||
);
|
||||
},
|
||||
|
||||
isWorker() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
return (
|
||||
!currentBoard.hasAdmin(this.userId) && currentBoard.hasWorker(this.userId)
|
||||
);
|
||||
},
|
||||
|
||||
isLastAdmin() {
|
||||
const currentBoard = Boards.findOne(Session.get('currentBoard'));
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue