mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +01:00
Initial work on import of custom fields from Trello
* start adding import functionality * Add checkbox type to customFields
This commit is contained in:
parent
93a3fa9c75
commit
c89a0eb694
4 changed files with 59 additions and 2 deletions
|
|
@ -52,6 +52,17 @@ template(name="cardCustomField-number")
|
|||
if value
|
||||
= value
|
||||
|
||||
template(name="cardCustomField-checkbox")
|
||||
if canModifyCard
|
||||
+inlinedForm(classNames="js-card-customfield-checkbox")
|
||||
input(type="checkbox" value=data.value)
|
||||
.edit-controls.clearfix
|
||||
button.primary(type="submit") {{_ 'save'}}
|
||||
a.fa.fa-times-thin.js-close-inlined-form
|
||||
else
|
||||
if value
|
||||
= value
|
||||
|
||||
template(name="cardCustomField-currency")
|
||||
if canModifyCard
|
||||
+inlinedForm(classNames="js-card-customfield-currency")
|
||||
|
|
|
|||
|
|
@ -78,7 +78,26 @@ CardCustomField.register('cardCustomField');
|
|||
},
|
||||
];
|
||||
}
|
||||
}.register('cardCustomField-number'));
|
||||
}.register('cardCustomField-checkbox'));
|
||||
|
||||
// cardCustomField-checkbox
|
||||
(class extends CardCustomField {
|
||||
onCreated() {
|
||||
super.onCreated();
|
||||
}
|
||||
|
||||
events() {
|
||||
return [
|
||||
{
|
||||
'submit .js-card-customfield-checkbox'(event) {
|
||||
event.preventDefault();
|
||||
const value = this.find('input').value !== '';
|
||||
this.card.setCustomField(this.customFieldId, value);
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
}.register('cardCustomField-checkbox'));
|
||||
|
||||
// cardCustomField-currency
|
||||
(class extends CardCustomField {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue