diff options
author | Lauri Ojansivu <x@xet7.org> | 2020-02-05 01:17:15 +0200 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2020-02-05 01:17:15 +0200 |
commit | 65fa2f626f503b8089e0d982901cffb3990426cb (patch) | |
tree | 1332d9e7eaa048ddfb1061d52d7bd68a46f5d9da /client/components/sidebar | |
parent | 58df99d5be8460a56b06ff3151b7d63d7d12437b (diff) | |
parent | 0b00a8095ce34c753e5edac86d4b62e8aaa1b1e0 (diff) | |
download | wekan-65fa2f626f503b8089e0d982901cffb3990426cb.tar.gz wekan-65fa2f626f503b8089e0d982901cffb3990426cb.tar.bz2 wekan-65fa2f626f503b8089e0d982901cffb3990426cb.zip |
Merge branch 'dollybean' of https://github.com/2020product/wekan into 2020product-dollybean
Diffstat (limited to 'client/components/sidebar')
-rw-r--r-- | client/components/sidebar/sidebar.jade | 92 | ||||
-rw-r--r-- | client/components/sidebar/sidebar.js | 296 |
2 files changed, 388 insertions, 0 deletions
diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade index 8e84cd61..fe0810a5 100644 --- a/client/components/sidebar/sidebar.jade +++ b/client/components/sidebar/sidebar.jade @@ -72,6 +72,88 @@ template(name="boardChangeColorPopup") if isSelected i.fa.fa-check +template(name="boardCardSettingsPopup") + form.board-card-settings + h3 {{_ 'show-on-card'}} + div.check-div + a.flex.js-field-has-receiveddate(class="{{#if allowsReceivedDate}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsReceivedDate}}is-checked{{/if}}") + span + i.fa.fa-sign-out + | {{_ 'card-received'}} + div.check-div + a.flex.js-field-has-startdate(class="{{#if allowsStartDate}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsStartDate}}is-checked{{/if}}") + span + i.fa.fa-hourglass-start + | {{_ 'card-start'}} + div.check-div + a.flex.js-field-has-duedate(class="{{#if allowsDueDate}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsDueDate}}is-checked{{/if}}") + span + i.fa.fa-sign-in + | {{_ 'card-due'}} + div.check-div + a.flex.js-field-has-enddate(class="{{#if allowsEndDate}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsEndDate}}is-checked{{/if}}") + span + i.fa.fa-hourglass-end + | {{_ 'card-end'}} + div.check-div + a.flex.js-field-has-members(class="{{#if allowsMembers}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsMembers}}is-checked{{/if}}") + span + i.fa.fa-users + | {{_ 'members'}} + div.check-div + a.flex.js-field-has-assignee(class="{{#if allowsAssignee}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsAssignee}}is-checked{{/if}}") + span + i.fa.fa-user + | {{_ 'assignee'}} + div.check-div + a.flex.js-field-has-assigned-by(class="{{#if allowsAssignedBy}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsAssignedBy}}is-checked{{/if}}") + span + i.fa.fa-shopping-cart + | {{_ 'assigned-by'}} + div.check-div + a.flex.js-field-has-requested-by(class="{{#if allowsRequestedBy}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsRequestedBy}}is-checked{{/if}}") + span + i.fa.fa-user-plus + | {{_ 'requested-by'}} + div.check-div + a.flex.js-field-has-labels(class="{{#if allowsLabels}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsLabels}}is-checked{{/if}}") + span + i.fa.fa-tags + | {{_ 'labels'}} + div.check-div + a.flex.js-field-has-checklists(class="{{#if allowsChecklists}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsChecklists}}is-checked{{/if}}") + span + i.fa.fa-check + | {{_ 'checklists'}} + div.check-div + a.flex.js-field-has-subtasks(class="{{#if allowsSubtasks}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsSubtasks}}is-checked{{/if}}") + span + i.fa.fa-sitemap + | {{_ 'subtasks'}} + div.check-div + a.flex.js-field-has-attachments(class="{{#if allowsAttachments}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsAttachments}}is-checked{{/if}}") + span + i.fa.fa-paperclip + | {{_ 'attachments'}} + div.check-div + a.flex.js-field-has-comments(class="{{#if allowsComments}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsComments}}is-checked{{/if}}") + span + i.fa.fa-comment-o + | {{_ 'comment'}} + template(name="boardSubtaskSettingsPopup") form.board-subtask-settings h3 {{_ 'show-parent-in-minicard'}} @@ -198,6 +280,10 @@ template(name="boardMenuPopup") i.fa.fa-globe | {{_ 'outgoing-webhooks'}} li + a.js-card-settings + i.fa.fa-id-card-o + | {{_ 'card-settings'}} + li a.js-subtask-settings i.fa.fa-sitemap | {{_ 'subtask-settings'}} @@ -238,6 +324,12 @@ template(name="boardMenuPopup") a.js-subtask-settings i.fa.fa-sitemap | {{_ 'subtask-settings'}} + hr + ul.pop-over-list + li + a.js-Date-settings + i.fa.fa-calendar + | {{_ 'Date-settings'}} template(name="labelsWidget") .board-widget.board-widget-labels diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index e8f38b8c..678c16d2 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -208,6 +208,7 @@ Template.boardMenuPopup.events({ 'click .js-outgoing-webhooks': Popup.open('outgoingWebhooks'), 'click .js-import-board': Popup.open('chooseBoardSource'), 'click .js-subtask-settings': Popup.open('boardSubtaskSettings'), + 'click .js-card-settings': Popup.open('boardCardSettings'), }); Template.boardMenuPopup.helpers({ @@ -472,6 +473,10 @@ BlazeComponent.extendComponent({ return this.currentBoard.allowsSubtasks; }, + allowsReceivedDate() { + return this.currentBoard.allowsReceivedDate; + }, + isBoardSelected() { return this.currentBoard.subtasksDefaultBoardId === this.currentData()._id; }, @@ -587,6 +592,297 @@ BlazeComponent.extendComponent({ BlazeComponent.extendComponent({ onCreated() { + this.currentBoard = Boards.findOne(Session.get('currentBoard')); + }, + + allowsReceivedDate() { + return this.currentBoard.allowsReceivedDate; + }, + + allowsStartDate() { + return this.currentBoard.allowsStartDate; + }, + + allowsDueDate() { + return this.currentBoard.allowsDueDate; + }, + + allowsEndDate() { + return this.currentBoard.allowsEndDate; + }, + + allowsSubtasks() { + return this.currentBoard.allowsSubtasks; + }, + + allowsMembers() { + return this.currentBoard.allowsMembers; + }, + + allowsAssignee() { + return this.currentBoard.allowsAssignee; + }, + + allowsAssignedBy() { + return this.currentBoard.allowsAssignedBy; + }, + + allowsRequestedBy() { + return this.currentBoard.allowsRequestedBy; + }, + + allowsLabels() { + return this.currentBoard.allowsLabels; + }, + + allowsChecklists() { + return this.currentBoard.allowsChecklists; + }, + + allowsAttachments() { + return this.currentBoard.allowsAttachments; + }, + + allowsComments() { + return this.currentBoard.allowsComments; + }, + + isBoardSelected() { + return this.currentBoard.dateSettingsDefaultBoardID; + }, + + isNullBoardSelected() { + return ( + this.currentBoard.dateSettingsDefaultBoardId === null || + this.currentBoard.dateSettingsDefaultBoardId === undefined + ); + }, + + boards() { + return Boards.find( + { + archived: false, + 'members.userId': Meteor.userId(), + }, + { + sort: ['title'], + }, + ); + }, + + lists() { + return Lists.find( + { + boardId: this.currentBoard._id, + archived: false, + }, + { + sort: ['title'], + }, + ); + }, + + hasLists() { + return this.lists().count() > 0; + }, + + isListSelected() { + return ( + this.currentBoard.dateSettingsDefaultBoardId === this.currentData()._id + ); + }, + + events() { + return [ + { + 'click .js-field-has-receiveddate'(evt) { + evt.preventDefault(); + this.currentBoard.allowsReceivedDate = !this.currentBoard + .allowsReceivedDate; + this.currentBoard.setAllowsReceivedDate( + this.currentBoard.allowsReceivedDate, + ); + $(`.js-field-has-receiveddate ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsReceivedDate, + ); + $('.js-field-has-receiveddate').toggleClass( + CKCLS, + this.currentBoard.allowsReceivedDate, + ); + }, + 'click .js-field-has-startdate'(evt) { + evt.preventDefault(); + this.currentBoard.allowsStartDate = !this.currentBoard + .allowsStartDate; + this.currentBoard.setAllowsStartDate( + this.currentBoard.allowsStartDate, + ); + $(`.js-field-has-startdate ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsStartDate, + ); + $('.js-field-has-startdate').toggleClass( + CKCLS, + this.currentBoard.allowsStartDate, + ); + }, + 'click .js-field-has-enddate'(evt) { + evt.preventDefault(); + this.currentBoard.allowsEndDate = !this.currentBoard.allowsEndDate; + this.currentBoard.setAllowsEndDate(this.currentBoard.allowsEndDate); + $(`.js-field-has-enddate ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsEndDate, + ); + $('.js-field-has-enddate').toggleClass( + CKCLS, + this.currentBoard.allowsEndDate, + ); + }, + 'click .js-field-has-duedate'(evt) { + evt.preventDefault(); + this.currentBoard.allowsDueDate = !this.currentBoard.allowsDueDate; + this.currentBoard.setAllowsDueDate(this.currentBoard.allowsDueDate); + $(`.js-field-has-duedate ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsDueDate, + ); + $('.js-field-has-duedate').toggleClass( + CKCLS, + this.currentBoard.allowsDueDate, + ); + }, + 'click .js-field-has-subtasks'(evt) { + evt.preventDefault(); + this.currentBoard.allowsSubtasks = !this.currentBoard.allowsSubtasks; + this.currentBoard.setAllowsSubtasks(this.currentBoard.allowsSubtasks); + $(`.js-field-has-subtasks ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsSubtasks, + ); + $('.js-field-has-subtasks').toggleClass( + CKCLS, + this.currentBoard.allowsSubtasks, + ); + }, + 'click .js-field-has-members'(evt) { + evt.preventDefault(); + this.currentBoard.allowsMembers = !this.currentBoard.allowsMembers; + this.currentBoard.setAllowsMembers(this.currentBoard.allowsMembers); + $(`.js-field-has-members ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsMembers, + ); + $('.js-field-has-members').toggleClass( + CKCLS, + this.currentBoard.allowsMembers, + ); + }, + 'click .js-field-has-assignee'(evt) { + evt.preventDefault(); + this.currentBoard.allowsAssignee = !this.currentBoard.allowsAssignee; + this.currentBoard.setAllowsAssignee(this.currentBoard.allowsAssignee); + $(`.js-field-has-assignee ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsAssignee, + ); + $('.js-field-has-assignee').toggleClass( + CKCLS, + this.currentBoard.allowsAssignee, + ); + }, + 'click .js-field-has-assigned-by'(evt) { + evt.preventDefault(); + this.currentBoard.allowsAssignedBy = !this.currentBoard.allowsAssignedBy; + this.currentBoard.setAllowsAssignedBy(this.currentBoard.allowsAssignedBy); + $(`.js-field-has-assigned-by ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsAssignedBy, + ); + $('.js-field-has-assigned-by').toggleClass( + CKCLS, + this.currentBoard.allowsAssignedBy, + ); + }, + 'click .js-field-has-requested-by'(evt) { + evt.preventDefault(); + this.currentBoard.allowsRequestedBy = !this.currentBoard.allowsRequestedBy; + this.currentBoard.setAllowsRequestedBy(this.currentBoard.allowsRequestedBy); + $(`.js-field-has-requested-by ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsRequestedBy, + ); + $('.js-field-has-requested-by').toggleClass( + CKCLS, + this.currentBoard.allowsRequestedBy, + ); + }, + 'click .js-field-has-labels'(evt) { + evt.preventDefault(); + this.currentBoard.allowsLabels = !this.currentBoard.allowsLabels; + this.currentBoard.setAllowsLabels(this.currentBoard.allowsLabels); + $(`.js-field-has-labels ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsAssignee, + ); + $('.js-field-has-labels').toggleClass( + CKCLS, + this.currentBoard.allowsLabels, + ); + }, + 'click .js-field-has-checklists'(evt) { + evt.preventDefault(); + this.currentBoard.allowsChecklists = !this.currentBoard + .allowsChecklists; + this.currentBoard.setAllowsChecklists( + this.currentBoard.allowsChecklists, + ); + $(`.js-field-has-checklists ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsChecklists, + ); + $('.js-field-has-checklists').toggleClass( + CKCLS, + this.currentBoard.allowsChecklists, + ); + }, + 'click .js-field-has-attachments'(evt) { + evt.preventDefault(); + this.currentBoard.allowsAttachments = !this.currentBoard + .allowsAttachments; + this.currentBoard.setAllowsAttachments( + this.currentBoard.allowsAttachments, + ); + $(`.js-field-has-attachments ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsAttachments, + ); + $('.js-field-has-attachments').toggleClass( + CKCLS, + this.currentBoard.allowsAttachments, + ); + }, + 'click .js-field-has-comments'(evt) { + evt.preventDefault(); + this.currentBoard.allowsComments = !this.currentBoard.allowsComments; + this.currentBoard.setAllowsComments(this.currentBoard.allowsComments); + $(`.js-field-has-comments ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsComments, + ); + $('.js-field-has-comments').toggleClass( + CKCLS, + this.currentBoard.allowsComments, + ); + }, + }, + ]; + }, +}).register('boardCardSettingsPopup'); + +BlazeComponent.extendComponent({ + onCreated() { this.error = new ReactiveVar(''); this.loading = new ReactiveVar(false); }, |