Merge pull request #4940 from helioguardabaxo/badges-show-minicard

Badges show minicard
This commit is contained in:
Lauri Ojansivu 2023-05-31 19:16:59 +00:00 committed by GitHub
commit e386c16a7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 94 additions and 6 deletions

View file

@ -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

View file

@ -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

View file

@ -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,
);
},
},
];
},

View file

@ -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",

View file

@ -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 } };
},

View file

@ -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?