summaryrefslogtreecommitdiffstats
path: root/client/components/cards
diff options
context:
space:
mode:
Diffstat (limited to 'client/components/cards')
-rw-r--r--client/components/cards/cardDate.jade12
-rw-r--r--client/components/cards/cardDate.js6
-rw-r--r--client/components/cards/cardDetails.jade2
-rw-r--r--client/components/cards/cardDetails.js4
-rw-r--r--client/components/cards/checklists.jade21
-rw-r--r--client/components/cards/checklists.js6
6 files changed, 41 insertions, 10 deletions
diff --git a/client/components/cards/cardDate.jade b/client/components/cards/cardDate.jade
index a2a28bbd..525f27ed 100644
--- a/client/components/cards/cardDate.jade
+++ b/client/components/cards/cardDate.jade
@@ -15,6 +15,12 @@ template(name="editCardDate")
button.js-delete-date.negate.wide.right.js-delete-date {{_ 'delete'}}
template(name="dateBadge")
- a.js-edit-date.card-date(title="{{showTitle}}" class="{{classes}}")
- time(datetime="{{showISODate}}")
- | {{showDate}}
+ if canModifyCard
+ a.js-edit-date.card-date(title="{{showTitle}}" class="{{classes}}")
+ time(datetime="{{showISODate}}")
+ | {{showDate}}
+ else
+ a.card-date(title="{{showTitle}}" class="{{classes}}")
+ time(datetime="{{showISODate}}")
+ | {{showDate}}
+
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js
index 4d129e8e..3f69f384 100644
--- a/client/components/cards/cardDate.js
+++ b/client/components/cards/cardDate.js
@@ -86,6 +86,12 @@ const EditCardDate = BlazeComponent.extendComponent({
},
});
+Template.dateBadge.helpers({
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+});
+
// editCardStartDatePopup
(class extends EditCardDate {
onCreated() {
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 0c707eac..9c95e92f 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -28,7 +28,7 @@ template(name="cardDetails")
.card-details-item.card-details-item-labels
h3.card-details-item-title {{_ 'labels'}}
- a(class="{{#if currentUser.isBoardMember}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
+ a(class="{{#if canModifyCard}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
each labels
span.card-label(class="card-label-{{color}}" title=name)= name
if canModifyCard
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index ade1742d..b39f8e59 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -144,6 +144,10 @@ Template.cardDetailsActionsPopup.helpers({
isWatching() {
return this.findWatcher(Meteor.userId());
},
+
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
});
Template.cardDetailsActionsPopup.events({
diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade
index d84f47f4..a0d89351 100644
--- a/client/components/cards/checklists.jade
+++ b/client/components/cards/checklists.jade
@@ -17,9 +17,13 @@ template(name="checklistDetail")
else
.checklist-title
.checkbox.fa.fa-check-square-o
- a.js-delete-checklist {{_ "delete"}}...
+ if canModifyCard
+ a.js-delete-checklist {{_ "delete"}}...
span.checklist-stat(class="{{#if checklist.isFinished}}is-finished{{/if}}") {{checklist.finishedCount}}/{{checklist.itemCount}}
- h2.title.js-open-inlined-form.is-editable {{checklist.title}}
+ if canModifyCard
+ h2.title.js-open-inlined-form.is-editable {{checklist.title}}
+ else
+ h2.title {{checklist.title}}
+checklistItems(checklist = checklist)
template(name="addChecklistItemForm")
@@ -38,7 +42,7 @@ template(name="editChecklistItemForm")
button.primary.confirm.js-submit-edit-checklist-item-form(type="submit") {{_ 'save'}}
a.fa.fa-times-thin.js-close-inlined-form
span(title=createdAt) {{ moment createdAt }}
- if currentUser.isBoardMember
+ if canModifyCard
a.js-delete-checklist-item {{_ "delete"}}...
template(name="checklistItems")
@@ -48,7 +52,7 @@ template(name="checklistItems")
+editChecklistItemForm(type = 'item' item = item checklist = checklist)
else
+itemDetail(item = item checklist = checklist)
- if currentUser.isBoardMember
+ if canModifyCard
+inlinedForm(classNames="js-add-checklist-item" checklist = checklist)
+addChecklistItemForm
else
@@ -58,5 +62,10 @@ template(name="checklistItems")
template(name='itemDetail')
.item
- .check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
- .item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
+ if canModifyCard
+ .check-box.materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
+ .item-title.js-open-inlined-form.is-editable(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
+ else
+ .materialCheckBox(class="{{#if item.isFinished }}is-checked{{/if}}")
+ .item-title(class="{{#if item.isFinished }}is-checked{{/if}}") {{item.title}}
+
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 4e5b1b25..b8f5e443 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -77,6 +77,12 @@ BlazeComponent.extendComponent({
},
}).register('checklists');
+Template.itemDetail.helpers({
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+});
+
BlazeComponent.extendComponent({
toggleItem() {
const checklist = this.currentData().checklist;