diff --git a/client/components/cards/minicard.jade b/client/components/cards/minicard.jade index 8387475a0..0be625442 100644 --- a/client/components/cards/minicard.jade +++ b/client/components/cards/minicard.jade @@ -28,7 +28,8 @@ template(name="minicard") .date +cardSpentTime if cover - .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');") + if currentBoard.allowsCoverAttachmentOnMinicard + .minicard-cover(style="background-image: url('{{cover.link 'original'}}?dummyReloadAfterSessionEstablished={{sess}}');") .minicard-title if $eq 'prefix-with-full-path' currentBoard.presentParentTask .parent-prefix diff --git a/client/components/sidebar/sidebar.jade b/client/components/sidebar/sidebar.jade index 1056438fe..ead78a1ec 100644 --- a/client/components/sidebar/sidebar.jade +++ b/client/components/sidebar/sidebar.jade @@ -302,6 +302,12 @@ template(name="boardMinicardSettingsPopup") span i.fa.fa-align-left | {{_ 'description-on-minicard'}} + div.check-div + a.flex.js-field-has-cover-attachment-on-minicard(class="{{#if allowsCoverAttachmentOnMinicard}}is-checked{{/if}}") + .materialCheckBox(class="{{#if allowsCoverAttachmentOnMinicard}}is-checked{{/if}}") + span + i.fa.fa-paperclip + | {{_ 'cover-attachment-on-minicard'}} template(name="boardSubtaskSettingsPopup") form.board-subtask-settings diff --git a/client/components/sidebar/sidebar.js b/client/components/sidebar/sidebar.js index 087125df8..3c638f036 100644 --- a/client/components/sidebar/sidebar.js +++ b/client/components/sidebar/sidebar.js @@ -1326,6 +1326,10 @@ BlazeComponent.extendComponent({ return this.currentBoard.allowsDescriptionTextOnMinicard; }, + allowsCoverAttachmentOnMinicard() { + return this.currentBoard.allowsCoverAttachmentOnMinicard; + }, + lists() { return Lists.find( { @@ -1367,6 +1371,22 @@ BlazeComponent.extendComponent({ this.currentBoard.allowsDescriptionTextOnMinicard, ); }, + 'click .js-field-has-cover-attachment-on-minicard'(evt) { + evt.preventDefault(); + this.currentBoard.allowsCoverAttachmentOnMinicard = !this.currentBoard + .allowsCoverAttachmentOnMinicard; + this.currentBoard.setallowsCoverAttachmentOnMinicard( + this.currentBoard.allowsCoverAttachmentOnMinicard, + ); + $(`.js-field-has-cover-attachment-on-minicard ${MCB}`).toggleClass( + CKCLS, + this.currentBoard.allowsCoverAttachmentOnMinicard, + ); + $('.js-field-has-cover-attachment-on-minicard').toggleClass( + CKCLS, + this.currentBoard.allowsCoverAttachmentOnMinicard, + ); + }, }, ]; }, diff --git a/imports/i18n/data/en.i18n.json b/imports/i18n/data/en.i18n.json index c94cd83bd..1239b22c0 100644 --- a/imports/i18n/data/en.i18n.json +++ b/imports/i18n/data/en.i18n.json @@ -728,6 +728,7 @@ "deposit-subtasks-list": "Landing list for subtasks deposited here:", "show-parent-in-minicard": "Show parent in minicard:", "description-on-minicard": "Description on minicard", + "cover-attachment-on-minicard": "Cover attachment 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 0eb3f15f4..96f0be633 100644 --- a/models/boards.js +++ b/models/boards.js @@ -407,6 +407,14 @@ Boards.attachSchema( defaultValue: false, }, + allowsCoverAttachmentOnMinicard: { + /** + * Does the board allows cover attachment on minicard? + */ + type: Boolean, + defaultValue: false, + }, + allowsCardNumber: { /** * Does the board allows card numbers? @@ -1459,6 +1467,10 @@ Boards.mutations({ return { $set: { allowsDescriptionTextOnMinicard } }; }, + setallowsCoverAttachmentOnMinicard(allowsCoverAttachmentOnMinicard) { + return { $set: { allowsCoverAttachmentOnMinicard } }; + }, + setAllowsActivities(allowsActivities) { return { $set: { allowsActivities } }; }, diff --git a/public/api/wekan.yml b/public/api/wekan.yml index 74105d1b7..53c2be270 100644 --- a/public/api/wekan.yml +++ b/public/api/wekan.yml @@ -3006,6 +3006,10 @@ definitions: description: | Does the board allows description text on minicard? type: boolean + allowsCoverAttachmentOnMinicard: + description: | + Does the board allows cover attachment on minicard? + type: boolean allowsCardNumber: description: | Does the board allows card numbers?