summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/components/cards/minicard.jade5
-rw-r--r--client/components/lists/listBody.js10
-rw-r--r--client/components/sidebar/sidebarCustomFields.jade10
-rw-r--r--client/components/sidebar/sidebarCustomFields.js18
-rw-r--r--i18n/en.i18n.json2
-rw-r--r--models/customFields.js8
6 files changed, 51 insertions, 2 deletions
diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade
index 5c609802..f23e91b3 100644
--- a/client/components/cards/minicard.jade
+++ b/client/components/cards/minicard.jade
@@ -53,8 +53,9 @@ template(name="minicard")
each customFieldsWD
if definition.showOnCard
.minicard-custom-field
- .minicard-custom-field-item
- = definition.name
+ if definition.showLabelOnMiniCard
+ .minicard-custom-field-item
+ = definition.name
.minicard-custom-field-item
+viewer
= trueValue
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index d99d9dc8..66b50123 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -59,6 +59,8 @@ BlazeComponent.extendComponent({
swimlaneId,
type: 'cardType-card',
});
+
+
// In case the filter is active we need to add the newly inserted card in
// the list of exceptions -- cards that are not filtered. Otherwise the
// card will disappear instantly.
@@ -152,6 +154,14 @@ BlazeComponent.extendComponent({
this.labels = new ReactiveVar([]);
this.members = new ReactiveVar([]);
this.customFields = new ReactiveVar([]);
+
+ const currentBoardId = Session.get('currentBoard');
+ arr = []
+ _.forEach(Boards.findOne(currentBoardId).customFields().fetch(), function(field){
+ if(field.automaticallyOnCard)
+ arr.push({_id: field._id, value: null,})
+ })
+ this.customFields.set(arr);
},
reset() {
diff --git a/client/components/sidebar/sidebarCustomFields.jade b/client/components/sidebar/sidebarCustomFields.jade
index fd31e5ac..f0a17773 100644
--- a/client/components/sidebar/sidebarCustomFields.jade
+++ b/client/components/sidebar/sidebarCustomFields.jade
@@ -41,6 +41,16 @@ template(name="createCustomFieldPopup")
.materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}")
span {{_ 'show-field-on-card'}}
+ a.flex.js-field-automatically-on-card(class="{{#if automaticallyOnCard}}is-checked{{/if}}")
+ .materialCheckBox(class="{{#if automaticallyOnCard}}is-checked{{/if}}")
+
+ span {{_ 'automatically-field-on-card'}}
+
+ a.flex.js-field-showLabel-on-card(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}")
+ .materialCheckBox(class="{{#if showLabelOnMiniCard}}is-checked{{/if}}")
+
+ span {{_ 'showLabel-field-on-card'}}
+
button.primary.wide.left(type="button")
| {{_ 'save'}}
if _id
diff --git a/client/components/sidebar/sidebarCustomFields.js b/client/components/sidebar/sidebarCustomFields.js
index e56d744e..ccc8ffb9 100644
--- a/client/components/sidebar/sidebarCustomFields.js
+++ b/client/components/sidebar/sidebarCustomFields.js
@@ -83,6 +83,22 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
$target.find('.materialCheckBox').toggleClass('is-checked');
$target.toggleClass('is-checked');
},
+ 'click .js-field-automatically-on-card'(evt) {
+ let $target = $(evt.target);
+ if(!$target.hasClass('js-field-automatically-on-card')){
+ $target = $target.parent();
+ }
+ $target.find('.materialCheckBox').toggleClass('is-checked');
+ $target.toggleClass('is-checked');
+ },
+ 'click .js-field-showLabel-on-card'(evt) {
+ let $target = $(evt.target);
+ if(!$target.hasClass('js-field-showLabel-on-card')){
+ $target = $target.parent();
+ }
+ $target.find('.materialCheckBox').toggleClass('is-checked');
+ $target.toggleClass('is-checked');
+ },
'click .primary'(evt) {
evt.preventDefault();
@@ -92,6 +108,8 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
type: this.type.get(),
settings: this.getSettings(),
showOnCard: this.find('.js-field-show-on-card.is-checked') !== null,
+ showLabelOnMiniCard: this.find('.js-field-showLabel-on-card.is-checked') !== null,
+ automaticallyOnCard: this.find('.js-field-automatically-on-card.is-checked') !== null,
};
// insert or update
diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index e69101f0..fb005392 100644
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -482,6 +482,8 @@
"minutes": "minutes",
"seconds": "seconds",
"show-field-on-card": "Show this field on card",
+ "automatically-field-on-card": "Auto create on all cards",
+ "showLabel-field-on-card": "Show label on mini card",
"yes": "Yes",
"no": "No",
"accounts": "Accounts",
diff --git a/models/customFields.js b/models/customFields.js
index 203e46d0..5bb5e743 100644
--- a/models/customFields.js
+++ b/models/customFields.js
@@ -31,6 +31,12 @@ CustomFields.attachSchema(new SimpleSchema({
showOnCard: {
type: Boolean,
},
+ automaticallyOnCard: {
+ type: Boolean,
+ },
+ showLabelOnMiniCard: {
+ type: Boolean,
+ },
}));
CustomFields.allow({
@@ -115,6 +121,8 @@ if (Meteor.isServer) {
type: req.body.type,
settings: req.body.settings,
showOnCard: req.body.showOnCard,
+ automaticallyOnCard: req.body.automaticallyOnCard,
+ showLabelOnMiniCard: req.body.showLabelOnMiniCard,
boardId: paramBoardId,
});