diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-06-07 22:53:06 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-06-07 22:53:06 +0300 |
commit | b3bb03fed4c4ddef4492c40d79f7dc313b48c201 (patch) | |
tree | f72743a33a734822c97f4fdbacdcad644cae5771 /client/components/cards | |
parent | 123d9659c155b649e8aa112e474760d3fe3b7301 (diff) | |
parent | 1332a578901ae131f7a2a8fffd566072e5440e46 (diff) | |
download | wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.tar.gz wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.tar.bz2 wekan-b3bb03fed4c4ddef4492c40d79f7dc313b48c201.zip |
Merge branch 'moreFieldsColours' of https://github.com/rjevnikar/wekan into rjevnikar-moreFieldsColours
Diffstat (limited to 'client/components/cards')
-rw-r--r-- | client/components/cards/cardDetails.jade | 48 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 42 | ||||
-rw-r--r-- | client/components/cards/cardDetails.styl | 3 | ||||
-rw-r--r-- | client/components/cards/labels.styl | 42 |
4 files changed, 131 insertions, 4 deletions
diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index 55ee8d32..aa4829a9 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -108,6 +108,39 @@ template(name="cardDetails") +viewer = description + .card-details-items + .card-details-item.card-details-item-name + h3.card-details-item-title {{_ 'requested-by'}} + if canModifyCard + +inlinedForm(classNames="js-card-details-requester") + +editCardRequesterForm + else + a.js-open-inlined-form + if requestedBy + +viewer + = requestedBy + else + | {{_ 'add'}} + else if requestedBy + +viewer + = requestedBy + + .card-details-item.card-details-item-name + h3.card-details-item-title {{_ 'assigned-by'}} + if canModifyCard + +inlinedForm(classNames="js-card-details-assigner") + +editCardAssignerForm + else + a.js-open-inlined-form + if assignedBy + +viewer + = assignedBy + else + | {{_ 'add'}} + else if requestedBy + +viewer + = assignedBy + hr +checklists(cardId = _id) @@ -141,6 +174,18 @@ template(name="editCardTitleForm") button.primary.confirm.js-submit-edit-card-title-form(type="submit") {{_ 'save'}} a.fa.fa-times-thin.js-close-inlined-form +template(name="editCardRequesterForm") + input.js-edit-card-requester(type='text' autofocus value=requestedBy) + .edit-controls.clearfix + button.primary.confirm.js-submit-edit-card-requester-form(type="submit") {{_ 'save'}} + a.fa.fa-times-thin.js-close-inlined-form + +template(name="editCardAssignerForm") + input.js-edit-card-assigner(type='text' autofocus value=assignedBy) + .edit-controls.clearfix + button.primary.confirm.js-submit-edit-card-assigner-form(type="submit") {{_ 'save'}} + a.fa.fa-times-thin.js-close-inlined-form + template(name="cardDetailsActionsPopup") ul.pop-over-list li: a.js-toggle-watch-card {{#if isWatching}}{{_ 'unwatch'}}{{else}}{{_ 'watch'}}{{/if}} @@ -150,8 +195,8 @@ template(name="cardDetailsActionsPopup") li: a.js-members {{_ 'card-edit-members'}} li: a.js-labels {{_ 'card-edit-labels'}} li: a.js-attachments {{_ 'card-edit-attachments'}} - li: a.js-received-date {{_ 'editCardReceivedDatePopup-title'}} li: a.js-custom-fields {{_ 'card-edit-custom-fields'}} + li: a.js-received-date {{_ 'editCardReceivedDatePopup-title'}} li: a.js-start-date {{_ 'editCardStartDatePopup-title'}} li: a.js-due-date {{_ 'editCardDueDatePopup-title'}} li: a.js-end-date {{_ 'editCardEndDatePopup-title'}} @@ -178,7 +223,6 @@ template(name="copyCardPopup") = title +boardsAndLists - template(name="copyChecklistToManyCardsPopup") label(for='copy-checklist-cards-title') {{_ 'copyChecklistToManyCardsPopup-instructions'}}: textarea#copy-card-title.minicard-composer-textarea.js-card-title(autofocus) diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 26549fda..6cbc4572 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -146,6 +146,20 @@ BlazeComponent.extendComponent({ this.data().setTitle(title); } }, + 'submit .js-card-details-assigner'(evt) { + evt.preventDefault(); + const assigner = this.currentComponent().getValue().trim(); + if (assigner) { + this.data().setAssignedBy(assigner); + } + }, + 'submit .js-card-details-requester'(evt) { + evt.preventDefault(); + const requester = this.currentComponent().getValue().trim(); + if (requester) { + this.data().setRequestedBy(requester); + } + }, 'click .js-member': Popup.open('cardMember'), 'click .js-add-members': Popup.open('cardMembers'), 'click .js-add-labels': Popup.open('cardLabels'), @@ -215,8 +229,8 @@ Template.cardDetailsActionsPopup.events({ 'click .js-members': Popup.open('cardMembers'), 'click .js-labels': Popup.open('cardLabels'), 'click .js-attachments': Popup.open('cardAttachments'), - 'click .js-received-date': Popup.open('editCardReceivedDate'), 'click .js-custom-fields': Popup.open('cardCustomFields'), + 'click .js-received-date': Popup.open('editCardReceivedDate'), 'click .js-start-date': Popup.open('editCardStartDate'), 'click .js-due-date': Popup.open('editCardDueDate'), 'click .js-end-date': Popup.open('editCardEndDate'), @@ -263,6 +277,32 @@ Template.editCardTitleForm.events({ }, }); +Template.editCardRequesterForm.onRendered(function() { + autosize(this.$('.js-edit-card-requester')); +}); + +Template.editCardRequesterForm.events({ + 'keydown .js-edit-card-requester'(evt) { + // If enter key was pressed, submit the data + if (evt.keyCode === 13) { + $('.js-submit-edit-card-requester-form').click(); + } + }, +}); + +Template.editCardAssignerForm.onRendered(function() { + autosize(this.$('.js-edit-card-assigner')); +}); + +Template.editCardAssignerForm.events({ + 'keydown .js-edit-card-assigner'(evt) { + // If enter key was pressed, submit the data + if (evt.keyCode === 13) { + $('.js-submit-edit-card-assigner-form').click(); + } + }, +}); + Template.moveCardPopup.events({ 'click .js-done' () { // XXX We should *not* get the currentCard from the global state, but diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl index 7dbe8732..11660593 100644 --- a/client/components/cards/cardDetails.styl +++ b/client/components/cards/cardDetails.styl @@ -82,7 +82,8 @@ &.card-details-item-start, &.card-details-item-due, &.card-details-item-end, - &.card-details-item-customfield + &.card-details-item-customfield, + &.card-details-item-name max-width: 50% flex-grow: 1 diff --git a/client/components/cards/labels.styl b/client/components/cards/labels.styl index 361a17ae..084af64c 100644 --- a/client/components/cards/labels.styl +++ b/client/components/cards/labels.styl @@ -73,6 +73,48 @@ .card-label-lime background-color: #51e898 +.card-label-silver + background-color: #c0c0c0 + +.card-label-peachpuff + background-color: #ffdab9 + +.card-label-crimson + background-color: #dc143c + +.card-label-plum + background-color: #dda0dd + +.card-label-darkgreen + background-color: #006400 + +.card-label-slateblue + background-color: #6a5acd + +.card-label-magenta + background-color: #ff00ff + +.card-label-gold + background-color: #ffd700 + +.card-label-navy + background-color: #000080 + +.card-label-gray + background-color: #808080 + +.card-label-saddlebrown + background-color: #8b4513 + +.card-label-paleturquoise + background-color: #afeeee + +.card-label-mistyrose + background-color: #ffe4e1 + +.card-label-indigo + background-color: #4b0082 + .edit-label, .create-label .card-label |