summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/cards/cardDetails.jade43
-rw-r--r--client/components/cards/cardDetails.js4
-rw-r--r--client/components/cards/checklists.jade13
-rw-r--r--client/components/cards/checklists.js4
-rw-r--r--client/components/lists/listBody.jade2
-rw-r--r--client/components/lists/listBody.js7
-rw-r--r--client/components/lists/listHeader.jade2
7 files changed, 46 insertions, 29 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index cf113951..0c707eac 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -8,7 +8,7 @@ template(name="cardDetails")
if currentUser.isBoardMember
a.fa.fa-navicon.card-details-menu.js-open-card-details-menu
h2.card-details-title.js-card-title(
- class="{{#if currentUser.isBoardMember}}js-open-inlined-form is-editable{{/if}}")
+ class="{{#if canModifyCard}}js-open-inlined-form is-editable{{/if}}")
= title
if isWatching
i.fa.fa-eye.card-details-watch
@@ -22,7 +22,7 @@ template(name="cardDetails")
each members
+userAvatar(userId=this cardId=../_id)
| {{! XXX Hack to hide syntaxic coloration /// }}
- if currentUser.isBoardMember
+ if canModifyCard
a.member.add-member.card-details-item-add-button.js-add-members(title="{{_ 'card-members-title'}}")
i.fa.fa-plus
@@ -31,7 +31,7 @@ template(name="cardDetails")
a(class="{{#if currentUser.isBoardMember}}js-add-labels{{else}}is-disabled{{/if}}" title="{{_ 'card-labels-title'}}")
each labels
span.card-label(class="card-label-{{color}}" title=name)= name
- if currentUser.isBoardMember
+ if canModifyCard
a.card-label.add-label.js-add-labels(title="{{_ 'card-labels-title'}}")
i.fa.fa-plus
@@ -47,7 +47,7 @@ template(name="cardDetails")
//- XXX We should use "editable" to avoid repetiting ourselves
- if currentUser.isBoardMember
+ if canModifyCard
h3.card-details-item-title {{_ 'description'}}
+inlinedCardDescription(classNames="card-description js-card-description")
+editor(autofocus=true)
@@ -101,23 +101,24 @@ template(name="editCardTitleForm")
template(name="cardDetailsActionsPopup")
ul.pop-over-list
li: a.js-toggle-watch-card {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}}
- hr
- ul.pop-over-list
- li: a.js-members {{_ 'card-edit-members'}}
- li: a.js-labels {{_ 'card-edit-labels'}}
- li: a.js-attachments {{_ 'card-edit-attachments'}}
- li: a.js-start-date {{_ 'editCardStartDatePopup-title'}}
- li: a.js-due-date {{_ 'editCardDueDatePopup-title'}}
- hr
- ul.pop-over-list
- li: a.js-move-card-to-top {{_ 'moveCardToTop-title'}}
- li: a.js-move-card-to-bottom {{_ 'moveCardToBottom-title'}}
- hr
- ul.pop-over-list
- li: a.js-move-card {{_ 'moveCardPopup-title'}}
- unless archived
- li: a.js-archive {{_ 'archive-card'}}
- li: a.js-more {{_ 'cardMorePopup-title'}}
+ if canModifyCard
+ hr
+ ul.pop-over-list
+ li: a.js-members {{_ 'card-edit-members'}}
+ li: a.js-labels {{_ 'card-edit-labels'}}
+ li: a.js-attachments {{_ 'card-edit-attachments'}}
+ li: a.js-start-date {{_ 'editCardStartDatePopup-title'}}
+ li: a.js-due-date {{_ 'editCardDueDatePopup-title'}}
+ hr
+ ul.pop-over-list
+ li: a.js-move-card-to-top {{_ 'moveCardToTop-title'}}
+ li: a.js-move-card-to-bottom {{_ 'moveCardToBottom-title'}}
+ hr
+ ul.pop-over-list
+ li: a.js-move-card {{_ 'moveCardPopup-title'}}
+ unless archived
+ li: a.js-archive {{_ 'archive-card'}}
+ li: a.js-more {{_ 'cardMorePopup-title'}}
template(name="moveCardPopup")
+boardLists
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index b7e0ef76..ade1742d 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -28,6 +28,10 @@ BlazeComponent.extendComponent({
return card.findWatcher(Meteor.userId());
},
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+
scrollParentContainer() {
const cardPanelWidth = 510;
const bodyBoardComponent = this.parentComponent();
diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade
index 987e6cd9..d84f47f4 100644
--- a/client/components/cards/checklists.jade
+++ b/client/components/cards/checklists.jade
@@ -3,12 +3,13 @@ template(name="checklists")
.card-checklist-items
each checklist in currentCard.checklists
+checklistDetail(checklist = checklist)
- +inlinedForm(classNames="js-add-checklist" cardId = cardId)
- +addChecklistItemForm
- else
- a.js-open-inlined-form
- i.fa.fa-plus
- | {{_ 'add-checklist'}}...
+ if canModifyCard
+ +inlinedForm(classNames="js-add-checklist" cardId = cardId)
+ +addChecklistItemForm
+ else
+ a.js-open-inlined-form
+ i.fa.fa-plus
+ | {{_ 'add-checklist'}}...
template(name="checklistDetail")
+inlinedForm(classNames="js-edit-checklist-title" checklist = checklist)
diff --git a/client/components/cards/checklists.js b/client/components/cards/checklists.js
index 5dac7bd3..4e5b1b25 100644
--- a/client/components/cards/checklists.js
+++ b/client/components/cards/checklists.js
@@ -26,6 +26,10 @@ BlazeComponent.extendComponent({
checklist.setTitle(title);
},
+ canModifyCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+
editChecklistItem(event) {
event.preventDefault();
diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade
index e659b179..01aa7179 100644
--- a/client/components/lists/listBody.jade
+++ b/client/components/lists/listBody.jade
@@ -12,7 +12,7 @@ template(name="listBody")
.materialCheckBox.multi-selection-checkbox.js-toggle-multi-selection(
class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
+minicard(this)
- if currentUser.isBoardMember
+ if canSeeAddCard
+inlinedForm(autoclose=false position="bottom")
+addCardForm(listId=_id position="bottom")
else
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index 34c2dcd6..bdc812c7 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -239,3 +239,10 @@ BlazeComponent.extendComponent({
});
},
}).register('addCardForm');
+
+
+Template.listBody.helpers({
+ canSeeAddCard() {
+ return Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
+ },
+});
diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade
index ae178c94..3f6ce0eb 100644
--- a/client/components/lists/listHeader.jade
+++ b/client/components/lists/listHeader.jade
@@ -25,8 +25,8 @@ template(name="editListTitleForm")
template(name="listActionPopup")
ul.pop-over-list
li: a.js-toggle-watch-list {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}}
- hr
unless currentUser.isCommentOnly
+ hr
ul.pop-over-list
li: a.js-add-card {{_ 'add-card'}}
if cards.count