mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 16:30:13 +01:00
Merge branch 'tugal-devel' into devel
This commit is contained in:
commit
e4c0623cf7
6 changed files with 51 additions and 2 deletions
|
|
@ -53,8 +53,9 @@ template(name="minicard")
|
||||||
each customFieldsWD
|
each customFieldsWD
|
||||||
if definition.showOnCard
|
if definition.showOnCard
|
||||||
.minicard-custom-field
|
.minicard-custom-field
|
||||||
.minicard-custom-field-item
|
if definition.showLabelOnMiniCard
|
||||||
= definition.name
|
.minicard-custom-field-item
|
||||||
|
= definition.name
|
||||||
.minicard-custom-field-item
|
.minicard-custom-field-item
|
||||||
+viewer
|
+viewer
|
||||||
= trueValue
|
= trueValue
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ BlazeComponent.extendComponent({
|
||||||
swimlaneId,
|
swimlaneId,
|
||||||
type: 'cardType-card',
|
type: 'cardType-card',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// In case the filter is active we need to add the newly inserted card in
|
// 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
|
// the list of exceptions -- cards that are not filtered. Otherwise the
|
||||||
// card will disappear instantly.
|
// card will disappear instantly.
|
||||||
|
|
@ -152,6 +154,14 @@ BlazeComponent.extendComponent({
|
||||||
this.labels = new ReactiveVar([]);
|
this.labels = new ReactiveVar([]);
|
||||||
this.members = new ReactiveVar([]);
|
this.members = new ReactiveVar([]);
|
||||||
this.customFields = 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() {
|
reset() {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,16 @@ template(name="createCustomFieldPopup")
|
||||||
.materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}")
|
.materialCheckBox(class="{{#if showOnCard}}is-checked{{/if}}")
|
||||||
|
|
||||||
span {{_ 'show-field-on-card'}}
|
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")
|
button.primary.wide.left(type="button")
|
||||||
| {{_ 'save'}}
|
| {{_ 'save'}}
|
||||||
if _id
|
if _id
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,22 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
|
||||||
$target.find('.materialCheckBox').toggleClass('is-checked');
|
$target.find('.materialCheckBox').toggleClass('is-checked');
|
||||||
$target.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) {
|
'click .primary'(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
||||||
|
|
@ -92,6 +108,8 @@ const CreateCustomFieldPopup = BlazeComponent.extendComponent({
|
||||||
type: this.type.get(),
|
type: this.type.get(),
|
||||||
settings: this.getSettings(),
|
settings: this.getSettings(),
|
||||||
showOnCard: this.find('.js-field-show-on-card.is-checked') !== null,
|
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
|
// insert or update
|
||||||
|
|
|
||||||
|
|
@ -482,6 +482,8 @@
|
||||||
"minutes": "minutes",
|
"minutes": "minutes",
|
||||||
"seconds": "seconds",
|
"seconds": "seconds",
|
||||||
"show-field-on-card": "Show this field on card",
|
"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",
|
"yes": "Yes",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
"accounts": "Accounts",
|
"accounts": "Accounts",
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,12 @@ CustomFields.attachSchema(new SimpleSchema({
|
||||||
showOnCard: {
|
showOnCard: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
|
automaticallyOnCard: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
|
showLabelOnMiniCard: {
|
||||||
|
type: Boolean,
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
CustomFields.allow({
|
CustomFields.allow({
|
||||||
|
|
@ -115,6 +121,8 @@ if (Meteor.isServer) {
|
||||||
type: req.body.type,
|
type: req.body.type,
|
||||||
settings: req.body.settings,
|
settings: req.body.settings,
|
||||||
showOnCard: req.body.showOnCard,
|
showOnCard: req.body.showOnCard,
|
||||||
|
automaticallyOnCard: req.body.automaticallyOnCard,
|
||||||
|
showLabelOnMiniCard: req.body.showLabelOnMiniCard,
|
||||||
boardId: paramBoardId,
|
boardId: paramBoardId,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue