summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/cards/attachments.jade6
-rw-r--r--client/components/cards/cardDetails.jade73
-rw-r--r--client/components/sidebar/sidebar.jade14
-rw-r--r--client/components/sidebar/sidebar.js40
-rw-r--r--models/boards.js24
-rw-r--r--server/migrations.js32
6 files changed, 153 insertions, 36 deletions
diff --git a/client/components/cards/attachments.jade b/client/components/cards/attachments.jade
index 10b767f4..b695ea41 100644
--- a/client/components/cards/attachments.jade
+++ b/client/components/cards/attachments.jade
@@ -53,5 +53,7 @@ template(name="attachmentsGalery")
if currentUser.isBoardMember
unless currentUser.isCommentOnly
unless currentUser.isWorker
- li.attachment-item.add-attachment
- a.js-add-attachment {{_ 'add-attachment' }}
+ //li.attachment-item.add-attachment
+ a.js-add-attachment
+ i.fa.fa-paperclip
+ | {{_ 'add-attachment' }}
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index e8bb72a4..615ae1d5 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -95,7 +95,7 @@ template(name="cardDetails")
a.card-label.add-label.js-end-date
i.fa.fa-plus
- .card-details-items
+ //.card-details-items
if currentBoard.allowsMembers
.card-details-item.card-details-item-members
h3
@@ -141,7 +141,7 @@ template(name="cardDetails")
a.card-label.add-label.js-add-labels(title="{{_ 'card-labels-title'}}")
i.fa.fa-plus
- .card-details-items
+ //.card-details-items
each customFieldsWD
.card-details-item.card-details-item-customfield
h3.card-details-item-title
@@ -149,7 +149,7 @@ template(name="cardDetails")
= definition.name
+cardCustomField
- .card-details-items
+ //.card-details-items
if getSpentTime
.card-details-item.card-details-item-spent
if getIsOvertime
@@ -158,37 +158,7 @@ template(name="cardDetails")
h3.card-details-item-title {{_ 'spent-time-hours'}}
+cardSpentTime
- //- XXX We should use "editable" to avoid repetiting ourselves
- if canModifyCard
- unless currentUser.isWorker
- h3
- i.fa.fa-align-left
- card-details-item-title {{_ 'description'}}
- +inlinedCardDescription(classNames="card-description js-card-description")
- +editor(autofocus=true)
- | {{getUnsavedValue 'cardDescription' _id getDescription}}
- .edit-controls.clearfix
- button.primary(type="submit") {{_ 'save'}}
- a.fa.fa-times-thin.js-close-inlined-form
- else
- a.js-open-inlined-form
- if getDescription
- +viewer
- = getDescription
- else
- | {{_ 'edit'}}
- if (hasUnsavedValue 'cardDescription' _id)
- p.quiet
- | {{_ 'unsaved-description'}}
- a.js-open-inlined-form {{_ 'view-it'}}
- = ' - '
- a.js-close-inlined-form {{_ 'discard'}}
- else if getDescription
- h3.card-details-item-title {{_ 'description'}}
- +viewer
- = getDescription
-
- .card-details-items
+ //.card-details-items
if currentBoard.allowsRequestedBy
.card-details-item.card-details-item-name
h3
@@ -229,6 +199,41 @@ template(name="cardDetails")
+viewer
= getAssignedBy
+ //- XXX We should use "editable" to avoid repetiting ourselves
+ if canModifyCard
+ unless currentUser.isWorker
+ if currentBoard.allowsDescriptionTitle
+ h3
+ i.fa.fa-align-left
+ card-details-item-title {{_ 'description'}}
+ if currentBoard.allowsDescriptionText
+ +inlinedCardDescription(classNames="card-description js-card-description")
+ +editor(autofocus=true)
+ | {{getUnsavedValue 'cardDescription' _id getDescription}}
+ .edit-controls.clearfix
+ button.primary(type="submit") {{_ 'save'}}
+ a.fa.fa-times-thin.js-close-inlined-form
+ else
+ if currentBoard.allowsDescriptionText
+ a.js-open-inlined-form
+ if getDescription
+ +viewer
+ = getDescription
+ else
+ | {{_ 'edit'}}
+ if (hasUnsavedValue 'cardDescription' _id)
+ p.quiet
+ | {{_ 'unsaved-description'}}
+ a.js-open-inlined-form {{_ 'view-it'}}
+ = ' - '
+ a.js-close-inlined-form {{_ 'discard'}}
+ else if getDescription
+ if currentBoard.allowsDescriptionTitle
+ h3.card-details-item-title {{_ 'description'}}
+ if currentBoard.allowsDescriptionText
+ +viewer
+ = getDescription
+
.card-checklist-attachmentGalerys
.card-checklist-attachmentGalery.card-checklists
if currentBoard.allowsChecklists
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade
index 07da476f..ebcd8486 100644
--- a/client/components/sidebar/sidebar.jade
+++ b/client/components/sidebar/sidebar.jade
@@ -130,6 +130,20 @@ template(name="boardCardSettingsPopup")
i.fa.fa-tags
| {{_ 'labels'}}
div.check-div
+ a.flex.js-field-has-description-title(class="{{#if allowsDescriptionTitle}}is-checked{{/if}}")
+ .materialCheckBox(class="{{#if allowsDescriptionTitle}}is-checked{{/if}}")
+ span
+ i.fa.fa-align-left
+ | {{_ 'description'}}
+ | {{_ 'title'}}
+ div.check-div
+ a.flex.js-field-has-description-text(class="{{#if allowsDescriptionText}}is-checked{{/if}}")
+ .materialCheckBox(class="{{#if allowsDescriptionText}}is-checked{{/if}}")
+ span
+ i.fa.fa-align-left
+ | {{_ 'description'}}
+ | {{_ 'custom-field-text'}}
+ div.check-div
a.flex.js-field-has-checklists(class="{{#if allowsChecklists}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsChecklists}}is-checked{{/if}}")
span
diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js
index c3c00b08..8e640564 100644
--- a/client/components/sidebar/sidebar.js
+++ b/client/components/sidebar/sidebar.js
@@ -647,6 +647,14 @@ BlazeComponent.extendComponent({
return this.currentBoard.allowsComments;
},
+ allowsDescriptionTitle() {
+ return this.currentBoard.allowsDescriptionTitle;
+ },
+
+ allowsDescriptionText() {
+ return this.currentBoard.allowsDescriptionText;
+ },
+
isBoardSelected() {
return this.currentBoard.dateSettingsDefaultBoardID;
},
@@ -837,6 +845,38 @@ BlazeComponent.extendComponent({
this.currentBoard.allowsLabels,
);
},
+ 'click .js-field-has-description-title'(evt) {
+ evt.preventDefault();
+ this.currentBoard.allowsDescriptionTitle = !this.currentBoard
+ .allowsDescriptionTitle;
+ this.currentBoard.setAllowsDescriptionTitle(
+ this.currentBoard.allowsDescriptionTitle,
+ );
+ $(`.js-field-has-description-title ${MCB}`).toggleClass(
+ CKCLS,
+ this.currentBoard.allowsDescriptionTitle,
+ );
+ $('.js-field-has-description-title').toggleClass(
+ CKCLS,
+ this.currentBoard.allowsDescriptionTitle,
+ );
+ },
+ 'click .js-field-has-description-text'(evt) {
+ evt.preventDefault();
+ this.currentBoard.allowsDescriptionText = !this.currentBoard
+ .allowsDescriptionText;
+ this.currentBoard.setAllowsDescriptionText(
+ this.currentBoard.allowsDescriptionText,
+ );
+ $(`.js-field-has-description-text ${MCB}`).toggleClass(
+ CKCLS,
+ this.currentBoard.allowsDescriptionText,
+ );
+ $('.js-field-has-description-text').toggleClass(
+ CKCLS,
+ this.currentBoard.allowsDescriptionText,
+ );
+ },
'click .js-field-has-checklists'(evt) {
evt.preventDefault();
this.currentBoard.allowsChecklists = !this.currentBoard
diff --git a/models/boards.js b/models/boards.js
index ef074ad6..8862f301 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -332,6 +332,22 @@ Boards.attachSchema(
defaultValue: true,
},
+ allowsDescriptionTitle: {
+ /**
+ * Does the board allows description title?
+ */
+ type: Boolean,
+ defaultValue: true,
+ },
+
+ allowsDescriptionText: {
+ /**
+ * Does the board allows description text?
+ */
+ type: Boolean,
+ defaultValue: true,
+ },
+
allowsActivities: {
/**
* Does the board allows comments?
@@ -1127,6 +1143,14 @@ Boards.mutations({
return { $set: { allowsComments } };
},
+ setAllowsDescriptionTitle(allowsDescriptionTitle) {
+ return { $set: { allowsDescriptionTitle } };
+ },
+
+ setAllowsDescriptionText(allowsDescriptionText) {
+ return { $set: { allowsDescriptionText } };
+ },
+
setAllowsActivities(allowsActivities) {
return { $set: { allowsActivities } };
},
diff --git a/server/migrations.js b/server/migrations.js
index 3bbd9964..b4489987 100644
--- a/server/migrations.js
+++ b/server/migrations.js
@@ -1001,3 +1001,35 @@ Migrations.add('add-activities-allowed', () => {
noValidateMulti,
);
});
+
+Migrations.add('add-description-title-allowed', () => {
+ Boards.update(
+ {
+ allowsDescriptionTitle: {
+ $exists: false,
+ },
+ },
+ {
+ $set: {
+ allowsDescriptionTitle: true,
+ },
+ },
+ noValidateMulti,
+ );
+});
+
+Migrations.add('add-description-text-allowed', () => {
+ Boards.update(
+ {
+ allowsDescriptionText: {
+ $exists: false,
+ },
+ },
+ {
+ $set: {
+ allowsDescriptionText: true,
+ },
+ },
+ noValidateMulti,
+ );
+});