This commit is contained in:
guillaume 2018-11-09 14:12:17 +01:00
commit cb091c8a54
89 changed files with 1453 additions and 34 deletions

View file

@ -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

View file

@ -12,11 +12,11 @@ template(name="import")
template(name="importTextarea")
form
p: label(for='import-textarea') {{_ instruction}}
p: label(for='import-textarea') {{_ instruction}} {{_ 'import-board-instruction-about-errors'}}
textarea.js-import-json(placeholder="{{_ 'import-json-placeholder'}}" autofocus)
| {{jsonText}}
if isSandstorm
h1.warning DANGER !!! THIS DESTROYS YOUR IMPORTED DATA, CAUSES BOARD NOT FOUND ERROR WHEN YOU OPEN THIS GRAIN AGAIN https://github.com/wekan/wekan/issues/1430
h1.warning {{_ 'import-sandstorm-backup-warning'}}
p.warning {{_ 'import-sandstorm-warning'}}
input.primary.wide(type="submit" value="{{_ 'import'}}")

View file

@ -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() {

View file

@ -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

View file

@ -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