summaryrefslogtreecommitdiffstats
path: root/client/components
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-09-04 20:52:45 +0300
committerLauri Ojansivu <x@xet7.org>2018-09-04 20:52:45 +0300
commit372174232725eb73df86cf4f3b38e3c7db55978a (patch)
treed608bd8a531cee0854a618ca8aec65a12c41cc66 /client/components
parent0c351f4864ba1db3a23098723a7fe029f9cd3248 (diff)
parent910771708a1ec37d198e2a0589aad2f035fcb4ff (diff)
downloadwekan-372174232725eb73df86cf4f3b38e3c7db55978a.tar.gz
wekan-372174232725eb73df86cf4f3b38e3c7db55978a.tar.bz2
wekan-372174232725eb73df86cf4f3b38e3c7db55978a.zip
Merge branch 'devel'
Diffstat (limited to 'client/components')
-rw-r--r--client/components/cards/cardDetails.jade39
-rw-r--r--client/components/cards/minicard.jade9
-rw-r--r--client/components/sidebar/sidebar.jade15
-rw-r--r--client/components/sidebar/sidebar.js15
4 files changed, 49 insertions, 29 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 10828445..33d6d3b7 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -173,25 +173,28 @@ template(name="cardDetails")
+attachmentsGalery
hr
- .activity-title
- h3 {{ _ 'activity'}}
- if currentUser.isBoardMember
- .material-toggle-switch
- span.toggle-switch-title {{_ 'hide-system-messages'}}
- if hiddenSystemMessages
- input.toggle-switch(type="checkbox" id="toggleButton" checked="checked")
- else
- input.toggle-switch(type="checkbox" id="toggleButton")
- label.toggle-label(for="toggleButton")
+ unless currentUser.isNoComments
+ .activity-title
+ h3 {{ _ 'activity'}}
+ if currentUser.isBoardMember
+ .material-toggle-switch
+ span.toggle-switch-title {{_ 'hide-system-messages'}}
+ if hiddenSystemMessages
+ input.toggle-switch(type="checkbox" id="toggleButton" checked="checked")
+ else
+ input.toggle-switch(type="checkbox" id="toggleButton")
+ label.toggle-label(for="toggleButton")
if currentUser.isBoardMember
- +commentForm
- if isLoaded.get
- if isLinkedCard
- +activities(card=this mode="linkedcard")
- else if isLinkedBoard
- +activities(card=this mode="linkedboard")
- else
- +activities(card=this mode="card")
+ unless currentUser.isNoComments
+ +commentForm
+ unless currentUser.isNoComments
+ if isLoaded.get
+ if isLinkedCard
+ +activities(card=this mode="linkedcard")
+ else if isLinkedBoard
+ +activities(card=this mode="linkedboard")
+ else
+ +activities(card=this mode="card")
template(name="editCardTitleForm")
textarea.js-edit-card-title(rows='1' autofocus)
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index 37f537db..5c609802 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -65,10 +65,11 @@ template(name="minicard")
+userAvatar(userId=this)
.badges
- if comments.count
- .badge(title="{{_ 'card-comments-title' comments.count }}")
- span.badge-icon.fa.fa-comment-o.badge-comment
- span.badge-text= comments.count
+ unless currentUser.isNoComments
+ if comments.count
+ .badge(title="{{_ 'card-comments-title' comments.count }}")
+ span.badge-icon.fa.fa-comment-o.badge-comment
+ span.badge-text= comments.count
if getDescription
.badge.badge-state-image-only(title=getDescription)
span.badge-icon.fa.fa-align-left
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 6085c2ad..ec88ce7e 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -23,10 +23,11 @@ template(name='homeSidebar')
hr
+labelsWidget
hr
- h3
- i.fa.fa-comments-o
- | {{_ 'activities'}}
- +activities(mode="board")
+ unless currentUser.isNoComments
+ h3
+ i.fa.fa-comments-o
+ | {{_ 'activities'}}
+ +activities(mode="board")
template(name="membersWidget")
.board-widget.board-widget-members
@@ -146,6 +147,12 @@ template(name="changePermissionsPopup")
i.fa.fa-check
span.sub-name {{_ 'normal-desc'}}
li
+ a(class="{{#if isLastAdmin}}disabled{{else}}js-set-no-comments{{/if}}")
+ | {{_ 'no-comments'}}
+ if isNoComments
+ i.fa.fa-check
+ span.sub-name {{_ 'no-comments-desc'}}
+ li
a(class="{{#if isLastAdmin}}disabled{{else}}js-set-comment-only{{/if}}")
| {{_ 'comment-only'}}
if isCommentOnly
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index 5a9de74b..5d34c4a8 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -126,8 +126,11 @@ Template.memberPopup.helpers({
if(type === 'normal'){
const currentBoard = Boards.findOne(Session.get('currentBoard'));
const commentOnly = currentBoard.hasCommentOnly(this.userId);
+ const noComments = currentBoard.hasNoComments(this.userId);
if(commentOnly){
return TAPi18n.__('comment-only').toLowerCase();
+ } else if(noComments) {
+ return TAPi18n.__('no-comments').toLowerCase();
} else {
return TAPi18n.__(type).toLowerCase();
}
@@ -324,12 +327,13 @@ BlazeComponent.extendComponent({
}).register('addMemberPopup');
Template.changePermissionsPopup.events({
- 'click .js-set-admin, click .js-set-normal, click .js-set-comment-only'(event) {
+ 'click .js-set-admin, click .js-set-normal, click .js-set-no-comments, click .js-set-comment-only'(event) {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
const memberId = this.userId;
const isAdmin = $(event.currentTarget).hasClass('js-set-admin');
const isCommentOnly = $(event.currentTarget).hasClass('js-set-comment-only');
- currentBoard.setMemberPermission(memberId, isAdmin, isCommentOnly);
+ const isNoComments = $(event.currentTarget).hasClass('js-set-no-comments');
+ currentBoard.setMemberPermission(memberId, isAdmin, isNoComments, isCommentOnly);
Popup.back(1);
},
});
@@ -342,7 +346,12 @@ Template.changePermissionsPopup.helpers({
isNormal() {
const currentBoard = Boards.findOne(Session.get('currentBoard'));
- return !currentBoard.hasAdmin(this.userId) && !currentBoard.hasCommentOnly(this.userId);
+ return !currentBoard.hasAdmin(this.userId) && !currentBoard.hasNoComments(this.userId) && !currentBoard.hasCommentOnly(this.userId);
+ },
+
+ isNoComments() {
+ const currentBoard = Boards.findOne(Session.get('currentBoard'));
+ return !currentBoard.hasAdmin(this.userId) && currentBoard.hasNoComments(this.userId);
},
isCommentOnly() {