Added option to show/hide some badges on minicard

This commit is contained in:
helioguardabaxo 2023-05-31 14:49:02 -03:00
parent 7df32ff4ac
commit f3ebc4a28e
6 changed files with 94 additions and 6 deletions

View file

@ -132,9 +132,10 @@ template(name="minicard")
if expiredPoker if expiredPoker
span.badge-text {{ getPokerEstimation }} span.badge-text {{ getPokerEstimation }}
if attachments.length if attachments.length
.badge if currentBoard.allowsBadgeAttachmentOnMinicard
span.badge-icon.fa.fa-paperclip .badge
span.badge-text= attachments.length span.badge-icon.fa.fa-paperclip
span.badge-text= attachments.length
if checklists.count if checklists.count
.badge(class="{{#if checklistFinished}}is-finished{{/if}}") .badge(class="{{#if checklistFinished}}is-finished{{/if}}")
span.badge-icon.fa.fa-check-square-o span.badge-icon.fa.fa-check-square-o
@ -145,9 +146,10 @@ template(name="minicard")
span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}} span.badge-text.check-list-text {{subtasksFinishedCount}}/{{allSubtasksCount}}
//{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down //{{subtasksFinishedCount}}/{{subtasksCount}} does not work because when a subtaks is archived, the count goes down
if currentBoard.allowsCardSortingByNumber if currentBoard.allowsCardSortingByNumber
.badge if currentBoard.allowsCardSortingByNumberOnMinicard
span.badge-icon.fa.fa-sort .badge
span.badge-text.check-list-sort {{ sort }} span.badge-icon.fa.fa-sort
span.badge-text.check-list-sort {{ sort }}
if currentBoard.allowsDescriptionTextOnMinicard if currentBoard.allowsDescriptionTextOnMinicard
if getDescription if getDescription
.minicard-description .minicard-description

View file

@ -308,6 +308,18 @@ template(name="boardMinicardSettingsPopup")
span span
i.fa.fa-paperclip i.fa.fa-paperclip
| {{_ 'cover-attachment-on-minicard'}} | {{_ '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") template(name="boardSubtaskSettingsPopup")
form.board-subtask-settings form.board-subtask-settings

View file

@ -1330,6 +1330,14 @@ BlazeComponent.extendComponent({
return this.currentBoard.allowsCoverAttachmentOnMinicard; return this.currentBoard.allowsCoverAttachmentOnMinicard;
}, },
allowsBadgeAttachmentOnMinicard() {
return this.currentBoard.allowsBadgeAttachmentOnMinicard;
},
allowsCardSortingByNumberOnMinicard() {
return this.currentBoard.allowsCardSortingByNumberOnMinicard;
},
lists() { lists() {
return Lists.find( return Lists.find(
{ {
@ -1387,6 +1395,38 @@ BlazeComponent.extendComponent({
this.currentBoard.allowsCoverAttachmentOnMinicard, 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,
);
},
}, },
]; ];
}, },

View file

@ -729,6 +729,8 @@
"show-parent-in-minicard": "Show parent in minicard:", "show-parent-in-minicard": "Show parent in minicard:",
"description-on-minicard": "Description on minicard", "description-on-minicard": "Description on minicard",
"cover-attachment-on-minicard": "Cover attachment 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-full-path": "Prefix with full path",
"prefix-with-parent": "Prefix with parent", "prefix-with-parent": "Prefix with parent",
"subtext-with-full-path": "Subtext with full path", "subtext-with-full-path": "Subtext with full path",

View file

@ -415,6 +415,22 @@ Boards.attachSchema(
defaultValue: false, 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: { allowsCardNumber: {
/** /**
* Does the board allows card numbers? * Does the board allows card numbers?
@ -1471,6 +1487,14 @@ Boards.mutations({
return { $set: { allowsCoverAttachmentOnMinicard } }; return { $set: { allowsCoverAttachmentOnMinicard } };
}, },
setallowsBadgeAttachmentOnMinicard(allowsBadgeAttachmentOnMinicard) {
return { $set: { allowsBadgeAttachmentOnMinicard } };
},
setallowsCardSortingByNumberOnMinicard(allowsCardSortingByNumberOnMinicard) {
return { $set: { allowsCardSortingByNumberOnMinicard } };
},
setAllowsActivities(allowsActivities) { setAllowsActivities(allowsActivities) {
return { $set: { allowsActivities } }; return { $set: { allowsActivities } };
}, },

View file

@ -3010,6 +3010,14 @@ definitions:
description: | description: |
Does the board allows cover attachment on minicard? Does the board allows cover attachment on minicard?
type: boolean 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: allowsCardNumber:
description: | description: |
Does the board allows card numbers? Does the board allows card numbers?