diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 0be625442..b6a4b75e3 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -132,9 +132,10 @@ template(name="minicard") if expiredPoker span.badge-text {{ getPokerEstimation }} if attachments.length - .badge - span.badge-icon.fa.fa-paperclip - span.badge-text= attachments.length + if currentBoard.allowsBadgeAttachmentOnMinicard + .badge + span.badge-icon.fa.fa-paperclip + span.badge-text= attachments.length if checklists.count .badge(class="{{#if checklistFinished}}is-finished{{/if}}") span.badge-icon.fa.fa-check-square-o @@ -145,9 +146,10 @@ template(name="minicard") span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}} //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down if currentBoard.allowsCardSortingByNumber - .badge - span.badge-icon.fa.fa-sort - span.badge-text.check-list-sort {{ sort }} + if currentBoard.allowsCardSortingByNumberOnMinicard + .badge + span.badge-icon.fa.fa-sort + span.badge-text.check-list-sort {{ sort }} if currentBoard.allowsDescriptionTextOnMinicard if getDescription .minicard-description diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade index ead78a1ec..3ff88ec09 100644 --- a/client/components/sidebar/sidebar.jade +++ b/client/components/sidebar/sidebar.jade @@ -308,6 +308,18 @@ template(name="boardMinicardSettingsPopup") span i.fa.fa-paperclip | {{_ 'cover-attachment-on-minicard'}} + div.check-div + a.flex.js-field-has-badge-attachment-on-minicard(class="{{#if allowsBadgeAttachmentOnMinicard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsBadgeAttachmentOnMinicard}}is-checked{{/if}}") + span + i.fa.fa-paperclip + | {{_ 'badge-attachment-on-minicard'}} + div.check-div + a.flex.js-field-has-card-sorting-by-number-on-minicard(class="{{#if allowsCardSortingByNumberOnMinicard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsCardSortingByNumberOnMinicard}}is-checked{{/if}}") + span + i.fa.fa-sort + | {{_ 'card-sorting-by-number-on-minicard'}} template(name="boardSubtaskSettingsPopup") form.board-subtask-settings diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 3c638f036..6a205eecb 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -1330,6 +1330,14 @@ BlazeComponent.extendComponent({ return this.currentBoard.allowsCoverAttachmentOnMinicard; }, + allowsBadgeAttachmentOnMinicard() { + return this.currentBoard.allowsBadgeAttachmentOnMinicard; + }, + + allowsCardSortingByNumberOnMinicard() { + return this.currentBoard.allowsCardSortingByNumberOnMinicard; + }, + lists() { return Lists.find( { @@ -1387,6 +1395,38 @@ BlazeComponent.extendComponent({ this.currentBoard.allowsCoverAttachmentOnMinicard, ); }, + 'click .js-field-has-badge-attachment-on-minicard'(evt) { + evt.preventDefault(); + this.currentBoard.allowsBadgeAttachmentOnMinicard = !this.currentBoard + .allowsBadgeAttachmentOnMinicard; + this.currentBoard.setallowsBadgeAttachmentOnMinicard( + this.currentBoard.allowsBadgeAttachmentOnMinicard, + ); + $(`.js-field-has-badge-attachment-on-minicard ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsBadgeAttachmentOnMinicard, + ); + $('.js-field-has-badge-attachment-on-minicard').toggleClass( + CKCLS, + this.currentBoard.allowsBadgeAttachmentOnMinicard, + ); + }, + 'click .js-field-has-card-sorting-by-number-on-minicard'(evt) { + evt.preventDefault(); + this.currentBoard.allowsCardSortingByNumberOnMinicard = !this.currentBoard + .allowsCardSortingByNumberOnMinicard; + this.currentBoard.setallowsCardSortingByNumberOnMinicard( + this.currentBoard.allowsCardSortingByNumberOnMinicard, + ); + $(`.js-field-has-card-sorting-by-number-on-minicard ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsCardSortingByNumberOnMinicard, + ); + $('.js-field-has-card-sorting-by-number-on-minicard').toggleClass( + CKCLS, + this.currentBoard.allowsCardSortingByNumberOnMinicard, + ); + }, }, ]; }, diff --git a/imports/i18n/data/en.i18n.json b/imports/i18n/data/en.i18n.json index 1239b22c0..4061c9ecd 100644 --- a/imports/i18n/data/en.i18n.json +++ b/imports/i18n/data/en.i18n.json @@ -729,6 +729,8 @@ "show-parent-in-minicard": "Show parent in minicard:", "description-on-minicard": "Description on minicard", "cover-attachment-on-minicard": "Cover attachment on minicard", + "badge-attachment-on-minicard": "Badge attachment on minicard", + "card-sorting-by-number-on-minicard": "Card sorting by number on minicard", "prefix-with-full-path": "Prefix with full path", "prefix-with-parent": "Prefix with parent", "subtext-with-full-path": "Subtext with full path", diff --git a/models/boards.js b/models/boards.js index 96f0be633..24ed7d3e0 100644 --- a/models/boards.js +++ b/models/boards.js @@ -415,6 +415,22 @@ Boards.attachSchema( defaultValue: false, }, + allowsBadgeAttachmentOnMinicard: { + /** + * Does the board allows badge attachment on minicard? + */ + type: Boolean, + defaultValue: false, + }, + + allowsCardSortingByNumberOnMinicard: { + /** + * Does the board allows card sorting by number on minicard? + */ + type: Boolean, + defaultValue: false, + }, + allowsCardNumber: { /** * Does the board allows card numbers? @@ -1471,6 +1487,14 @@ Boards.mutations({ return { $set: { allowsCoverAttachmentOnMinicard } }; }, + setallowsBadgeAttachmentOnMinicard(allowsBadgeAttachmentOnMinicard) { + return { $set: { allowsBadgeAttachmentOnMinicard } }; + }, + + setallowsCardSortingByNumberOnMinicard(allowsCardSortingByNumberOnMinicard) { + return { $set: { allowsCardSortingByNumberOnMinicard } }; + }, + setAllowsActivities(allowsActivities) { return { $set: { allowsActivities } }; }, diff --git a/public/api/wekan.yml b/public/api/wekan.yml index 53c2be270..e9965ebbe 100644 --- a/public/api/wekan.yml +++ b/public/api/wekan.yml @@ -3010,6 +3010,14 @@ definitions: description: | Does the board allows cover attachment on minicard? type: boolean + allowsBadgeAttachmentOnMinicard: + description: | + Does the board allows badge attachment on minicard? + type: boolean + allowsCardSortingByNumberOnMinicard: + description: | + Does the board allows card sorting by number on minicard? + type: boolean allowsCardNumber: description: | Does the board allows card numbers?