summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorPouyan Savoli <papoola@hotmail.com>2017-09-05 02:34:18 +0200
committerPouyan Savoli <papoola@hotmail.com>2017-09-22 22:59:32 +0200
commit6ff89b43b61ace7ea26d50f091ea6b714fa79c84 (patch)
tree362c1bc771df9d20ab756cd4d8f26cf9f2d10246 /client
parent733b14dcd8f4b94047ffd444e7ab7ded49c245c0 (diff)
downloadwekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.tar.gz
wekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.tar.bz2
wekan-6ff89b43b61ace7ea26d50f091ea6b714fa79c84.zip
show custom fields on cards but still with dummy value
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardCustomFields.jade23
-rw-r--r--client/components/cards/cardCustomFields.js41
-rw-r--r--client/components/cards/cardDetails.jade20
-rw-r--r--client/components/cards/cardDetails.js14
4 files changed, 68 insertions, 30 deletions
diff --git a/client/components/cards/cardCustomFields.jade b/client/components/cards/cardCustomFields.jade
new file mode 100644
index 00000000..3c885b93
--- /dev/null
+++ b/client/components/cards/cardCustomFields.jade
@@ -0,0 +1,23 @@
+template(name="cardCustomFieldsPopup")
+ ul.pop-over-list
+ each board.customFields
+ li.item(class="")
+ a.name.js-select-field(href="#")
+ span.full-name
+ = name
+ if isCardMember
+ i.fa.fa-check
+ hr
+ a.quiet-button.full.js-configure-custom-fields
+ i.fa.fa-cog
+ span {{_ 'configure-custom-fields'}}
+
+template(name="cardCustomFieldText")
+ if canModifyCard
+ .item-title.js-open-inlined-form.is-editable
+ if value
+ = value
+ else
+ | {{_ 'edit'}}
+ else
+ .item-title {{value}} \ No newline at end of file
diff --git a/client/components/cards/cardCustomFields.js b/client/components/cards/cardCustomFields.js
new file mode 100644
index 00000000..73dda02e
--- /dev/null
+++ b/client/components/cards/cardCustomFields.js
@@ -0,0 +1,41 @@
+Template.cardCustomFieldsPopup.events({
+ 'click .js-select-field'(evt) {
+ const card = Cards.findOne(Session.get('currentCard'));
+ const customFieldId = this._id;
+ card.toggleCustomField(customFieldId);
+ evt.preventDefault();
+ },
+ 'click .js-configure-custom-fields'(evt) {
+ EscapeActions.executeUpTo('detailsPane');
+ Sidebar.setView('customFields');
+ evt.preventDefault();
+ }
+});
+
+const CardCustomField = BlazeComponent.extendComponent({
+ template() {
+ return 'cardCustomFieldText';
+ },
+
+ onCreated() {
+ const self = this;
+ self.date = ReactiveVar();
+ self.now = ReactiveVar(moment());
+ },
+
+ value() {
+ return "this is the value";
+ },
+
+ showISODate() {
+ return this.date.get().toISOString();
+ },
+
+ events() {
+ return [{
+ 'click .js-edit-date': Popup.open('editCardStartDate'),
+ }];
+ },
+});
+
+CardCustomField.register('cardCustomField'); \ No newline at end of file
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade
index 7cb4f8d8..f72abe6d 100644
--- a/client/components/cards/cardDetails.jade
+++ b/client/components/cards/cardDetails.jade
@@ -45,9 +45,11 @@ template(name="cardDetails")
h3.card-details-item-title {{_ 'card-due'}}
+cardDueDate
- each customFields
+ each customFieldsWD
.card-details-item.card-details-item-customfield
- h3.card-details-item-title {{_ 'some-title' }}
+ h3.card-details-item-title
+ = definition.name
+ +cardCustomField
//- XXX We should use "editable" to avoid repetiting ourselves
if canModifyCard
@@ -147,20 +149,6 @@ template(name="cardMembersPopup")
if isCardMember
i.fa.fa-check
-template(name="cardCustomFieldsPopup")
- ul.pop-over-list
- each board.customFields
- li.item(class="")
- a.name.js-select-field(href="#")
- span.full-name
- = name
- if isCardMember
- i.fa.fa-check
- hr
- a.quiet-button.full.js-configure-custom-fields
- i.fa.fa-cog
- span {{_ 'configure-custom-fields'}}
-
template(name="cardMorePopup")
p.quiet
span.clearfix
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 1cc39492..8d5c478d 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -197,20 +197,6 @@ Template.editCardTitleForm.events({
},
});
-Template.cardCustomFieldsPopup.events({
- 'click .js-select-field'(evt) {
- const card = Cards.findOne(Session.get('currentCard'));
- const customFieldId = this._id;
- card.toggleCustomField(customFieldId);
- evt.preventDefault();
- },
- 'click .js-configure-custom-fields'(evt) {
- EscapeActions.executeUpTo('detailsPane');
- Sidebar.setView('customFields');
- evt.preventDefault();
- }
-});
-
Template.moveCardPopup.events({
'click .js-select-list' () {
// XXX We should *not* get the currentCard from the global state, but