mirror of
https://github.com/wekan/wekan.git
synced 2026-02-04 07:31:47 +01:00
card model and card ui preparation for custom fields
This commit is contained in:
parent
afd87e3caa
commit
d87191f17e
5 changed files with 47 additions and 3 deletions
|
|
@ -45,6 +45,9 @@ template(name="cardDetails")
|
|||
h3.card-details-item-title {{_ 'card-due'}}
|
||||
+cardDueDate
|
||||
|
||||
each customFields
|
||||
.card-details-item.card-details-item-customfield
|
||||
h3.card-details-item-title {{_ 'some-title' }}
|
||||
|
||||
//- XXX We should use "editable" to avoid repetiting ourselves
|
||||
if canModifyCard
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ Template.editCardTitleForm.events({
|
|||
Template.cardCustomFieldsPopup.events({
|
||||
'click .js-select-field'(evt) {
|
||||
const card = Cards.findOne(Session.get('currentCard'));
|
||||
const customFieldId = this.customFieldId;
|
||||
const customFieldId = this._id;
|
||||
card.toggleCustomField(customFieldId);
|
||||
evt.preventDefault();
|
||||
},
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@
|
|||
|
||||
.card-details-items
|
||||
display: flex
|
||||
flex-wrap: wrap
|
||||
margin: 15px 0
|
||||
|
||||
.card-details-item
|
||||
|
|
@ -80,8 +81,8 @@
|
|||
&.card-details-item-members,
|
||||
&.card-details-item-start,
|
||||
&.card-details-item-due
|
||||
width: 50%
|
||||
flex-shrink: 1
|
||||
max-width: 50%
|
||||
flex-grow: 1
|
||||
|
||||
.card-details-item-title
|
||||
font-size: 14px
|
||||
|
|
|
|||
|
|
@ -35,12 +35,17 @@ BlazeComponent.extendComponent({
|
|||
|
||||
const members = formComponent.members.get();
|
||||
const labelIds = formComponent.labels.get();
|
||||
const customFields = formComponent.customFields.get();
|
||||
console.log("members", members);
|
||||
console.log("labelIds", labelIds);
|
||||
console.log("customFields", customFields);
|
||||
|
||||
if (title) {
|
||||
const _id = Cards.insert({
|
||||
title,
|
||||
members,
|
||||
labelIds,
|
||||
customFields,
|
||||
listId: this.data()._id,
|
||||
boardId: this.data().board()._id,
|
||||
sort: sortIndex,
|
||||
|
|
@ -121,11 +126,13 @@ BlazeComponent.extendComponent({
|
|||
onCreated() {
|
||||
this.labels = new ReactiveVar([]);
|
||||
this.members = new ReactiveVar([]);
|
||||
this.customFields = new ReactiveVar([]);
|
||||
},
|
||||
|
||||
reset() {
|
||||
this.labels.set([]);
|
||||
this.members.set([]);
|
||||
this.customFields.set([]);
|
||||
},
|
||||
|
||||
getLabels() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue