diff options
author | RJevnikar <12701645+rjevnikar@users.noreply.github.com> | 2018-03-26 19:04:02 +0000 |
---|---|---|
committer | RJevnikar <12701645+rjevnikar@users.noreply.github.com> | 2018-03-26 20:51:24 +0000 |
commit | 07217d0e5142028bbe794bdd3611e47890ab4bfb (patch) | |
tree | df4747598115c2daf6813d004bcd48a7446a48ad /client | |
parent | 80941e57d39138338761311964dc32ad25fd34ad (diff) | |
download | wekan-07217d0e5142028bbe794bdd3611e47890ab4bfb.tar.gz wekan-07217d0e5142028bbe794bdd3611e47890ab4bfb.tar.bz2 wekan-07217d0e5142028bbe794bdd3611e47890ab4bfb.zip |
Add additional dates (received & end), default title of checklists to 'Checklist'
Remove translations
Add additional dates (received & end), default name checklists to Checklist
Diffstat (limited to 'client')
-rw-r--r-- | client/components/cards/cardDate.js | 126 | ||||
-rw-r--r-- | client/components/cards/cardDate.styl | 10 | ||||
-rw-r--r-- | client/components/cards/cardDetails.jade | 45 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 6 | ||||
-rw-r--r-- | client/components/cards/cardDetails.styl | 4 | ||||
-rw-r--r-- | client/components/cards/checklists.jade | 2 |
6 files changed, 177 insertions, 16 deletions
diff --git a/client/components/cards/cardDate.js b/client/components/cards/cardDate.js index abf6a42b..7c0ad6ab 100644 --- a/client/components/cards/cardDate.js +++ b/client/components/cards/cardDate.js @@ -1,4 +1,4 @@ -// Edit start & due dates +// Edit received, start, due & end dates const EditCardDate = BlazeComponent.extendComponent({ template() { return 'editCardDate'; @@ -92,6 +92,23 @@ Template.dateBadge.helpers({ }, }); +// editCardReceivedDatePopup +(class extends EditCardDate { + onCreated() { + super.onCreated(); + this.data().receivedAt && this.date.set(moment(this.data().receivedAt)); + } + + _storeDate(date) { + this.card.setReceived(date); + } + + _deleteDate() { + this.card.unsetReceived(); + } +}).register('editCardReceivedDatePopup'); + + // editCardStartDatePopup (class extends EditCardDate { onCreated() { @@ -99,6 +116,13 @@ Template.dateBadge.helpers({ this.data().startAt && this.date.set(moment(this.data().startAt)); } + onRendered() { + super.onRendered(); + if (moment.isDate(this.card.receivedAt)) { + this.$('.js-datepicker').datepicker('setStartDate', this.card.receivedAt); + } + } + _storeDate(date) { this.card.setStart(date); } @@ -131,8 +155,31 @@ Template.dateBadge.helpers({ } }).register('editCardDueDatePopup'); +// editCardEndDatePopup +(class extends EditCardDate { + onCreated() { + super.onCreated(); + this.data().endAt && this.date.set(moment(this.data().endAt)); + } + + onRendered() { + super.onRendered(); + if (moment.isDate(this.card.startAt)) { + this.$('.js-datepicker').datepicker('setStartDate', this.card.startAt); + } + } + + _storeDate(date) { + this.card.setEnd(date); + } + + _deleteDate() { + this.card.unsetEnd(); + } +}).register('editCardEndDatePopup'); + -// Display start & due dates +// Display received, start, due & end dates const CardDate = BlazeComponent.extendComponent({ template() { return 'dateBadge'; @@ -161,6 +208,36 @@ const CardDate = BlazeComponent.extendComponent({ }, }); +class CardReceivedDate extends CardDate { + onCreated() { + super.onCreated(); + const self = this; + self.autorun(() => { + self.date.set(moment(self.data().receivedAt)); + }); + } + + classes() { + let classes = 'received-date' + ' '; + if (this.date.get().isBefore(this.now.get(), 'minute') && + this.now.get().isBefore(this.data().dueAt)) { + classes += 'current'; + } + return classes; + } + + showTitle() { + return `${TAPi18n.__('card-received-on')} ${this.date.get().format('LLLL')}`; + } + + events() { + return super.events().concat({ + 'click .js-edit-date': Popup.open('editCardReceivedDate'), + }); + } +} +CardReceivedDate.register('cardReceivedDate'); + class CardStartDate extends CardDate { onCreated() { super.onCreated(); @@ -223,6 +300,44 @@ class CardDueDate extends CardDate { } CardDueDate.register('cardDueDate'); +class CardEndDate extends CardDate { + onCreated() { + super.onCreated(); + const self = this; + self.autorun(() => { + self.date.set(moment(self.data().endAt)); + }); + } + + classes() { + let classes = 'end-date' + ' '; + if (this.data.dueAt.diff(this.date.get(), 'days') >= 2) + classes += 'long-overdue'; + else if (this.data.dueAt.diff(this.date.get(), 'days') >= 0) + classes += 'due'; + else if (this.data.dueAt.diff(this.date.get(), 'days') >= -2) + classes += 'almost-due'; + return classes; + } + + showTitle() { + return `${TAPi18n.__('card-end-on')} ${this.date.get().format('LLLL')}`; + } + + events() { + return super.events().concat({ + 'click .js-edit-date': Popup.open('editCardEndDate'), + }); + } +} +CardEndDate.register('cardEndDate'); + +(class extends CardReceivedDate { + showDate() { + return this.date.get().format('l'); + } +}).register('minicardReceivedDate'); + (class extends CardStartDate { showDate() { return this.date.get().format('l'); @@ -234,3 +349,10 @@ CardDueDate.register('cardDueDate'); return this.date.get().format('l'); } }).register('minicardDueDate'); + +(class extends CardEndDate { + showDate() { + return this.date.get().format('l'); + } +}).register('minicardEndDate'); + diff --git a/client/components/cards/cardDate.styl b/client/components/cards/cardDate.styl index e0c3fc9e..1ad3adb3 100644 --- a/client/components/cards/cardDate.styl +++ b/client/components/cards/cardDate.styl @@ -49,6 +49,11 @@ &:hover, &.is-active background-color: darken(#fd5d47, 7) + &.end-date + time + &::before + content: "\f253" // symbol: fa-hourglass-end + &.due-date time &::before @@ -59,6 +64,11 @@ &::before content: "\f08b" // symbol: fa-sign-out + &.received-date + time + &::before + content: "\f251" // symbol: fa-hourglass-start + time &::before font: normal normal normal 14px/1 FontAwesome diff --git a/client/components/cards/cardDetails.jade b/client/components/cards/cardDetails.jade index cc95ca38..3e73071a 100644 --- a/client/components/cards/cardDetails.jade +++ b/client/components/cards/cardDetails.jade @@ -18,6 +18,35 @@ template(name="cardDetails") p.warning {{_ 'card-archived'}} .card-details-items + .card-details-item.card-details-item-received + h3.card-details-item-title {{_ 'card-received'}} + if receivedAt + +cardReceivedDate + else + a.js-received-date {{_ 'add'}} + + .card-details-item.card-details-item-start + h3.card-details-item-title {{_ 'card-start'}} + if startAt + +cardStartDate + else + a.js-start-date {{_ 'add'}} + + .card-details-item.card-details-item-due + h3.card-details-item-title {{_ 'card-due'}} + if dueAt + +cardDueDate + else + a.js-due-date {{_ 'add'}} + + .card-details-item.card-details-item-end + h3.card-details-item-title {{_ 'card-end'}} + if endAt + +cardEndDate + else + a.js-end-date {{_ 'add'}} + + .card-details-items .card-details-item.card-details-item-members h3.card-details-item-title {{_ 'members'}} each members @@ -36,16 +65,6 @@ template(name="cardDetails") a.card-label.add-label.js-add-labels(title="{{_ 'card-labels-title'}}") i.fa.fa-plus - if startAt - .card-details-item.card-details-item-start - h3.card-details-item-title {{_ 'card-start'}} - +cardStartDate - - if dueAt - .card-details-item.card-details-item-due - h3.card-details-item-title {{_ 'card-due'}} - +cardDueDate - .card-details-items if spentTime .card-details-item.card-details-item-spent @@ -86,7 +105,7 @@ template(name="cardDetails") +checklists(cardId = _id) hr - h2 + h3 i.fa.fa-paperclip | {{_ 'attachments'}} @@ -94,7 +113,7 @@ template(name="cardDetails") hr .activity-title - h2 {{ _ 'activity'}} + h3 {{ _ 'activity'}} if currentUser.isBoardMember .material-toggle-switch span.toggle-switch-title {{_ 'hide-system-messages'}} @@ -124,8 +143,10 @@ 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-start-date {{_ 'editCardStartDatePopup-title'}} li: a.js-due-date {{_ 'editCardDueDatePopup-title'}} + li: a.js-end-date {{_ 'editCardEndDatePopup-title'}} li: a.js-spent-time {{_ 'editCardSpentTimePopup-title'}} hr ul.pop-over-list diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 77593a74..421cef53 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -149,6 +149,10 @@ BlazeComponent.extendComponent({ 'click .js-member': Popup.open('cardMember'), 'click .js-add-members': Popup.open('cardMembers'), 'click .js-add-labels': Popup.open('cardLabels'), + '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'), 'mouseenter .js-card-details' () { this.parentComponent().parentComponent().showOverlay.set(true); this.parentComponent().parentComponent().mouseHasEnterCardDetails = true; @@ -211,8 +215,10 @@ 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-start-date': Popup.open('editCardStartDate'), 'click .js-due-date': Popup.open('editCardDueDate'), + 'click .js-end-date': Popup.open('editCardEndDate'), 'click .js-spent-time': Popup.open('editCardSpentTime'), 'click .js-move-card': Popup.open('moveCard'), 'click .js-copy-card': Popup.open('copyCard'), diff --git a/client/components/cards/cardDetails.styl b/client/components/cards/cardDetails.styl index c67522d1..a1e0f5c3 100644 --- a/client/components/cards/cardDetails.styl +++ b/client/components/cards/cardDetails.styl @@ -77,8 +77,10 @@ margin-right: 0 &.card-details-item-labels, &.card-details-item-members, + &.card-details-item-received, &.card-details-item-start, - &.card-details-item-due + &.card-details-item-due, + &.card-details-item-end width: 50% flex-shrink: 1 diff --git a/client/components/cards/checklists.jade b/client/components/cards/checklists.jade index c79eb5aa..5a7c7473 100644 --- a/client/components/cards/checklists.jade +++ b/client/components/cards/checklists.jade @@ -1,5 +1,5 @@ template(name="checklists") - h2 {{_ 'checklists'}} + h3 {{_ 'checklists'}} if toggleDeleteDialog.get .board-overlay#card-details-overlay +checklistDeleteDialog(checklist = checklistToDelete) |