Fixed per-card and per-board settings of showing checkist at minicard.

Thanks to xet7 !
This commit is contained in:
Lauri Ojansivu 2025-10-11 11:31:57 +03:00
parent ea24010298
commit fc32a89292
11 changed files with 102 additions and 2 deletions

View file

@ -695,6 +695,14 @@ template(name="cardDetailsActionsPopup")
a.js-set-card-color
i.fa.fa-paint-brush
| {{_ 'setCardColorPopup-title'}}
li
a.js-toggle-show-list-on-minicard
if showListOnMinicard
i.fa.fa-eye
| {{_ 'hide-list-on-minicard'}}
else
i.fa.fa-eye-slash
| {{_ 'show-list-on-minicard'}}
hr
ul.pop-over-list
li

View file

@ -657,6 +657,10 @@ Template.cardDetailsActionsPopup.helpers({
isBoardAdmin() {
return ReactiveCache.getCurrentUser().isBoardAdmin();
},
showListOnMinicard() {
return this.showListOnMinicard;
},
});
Template.cardDetailsActionsPopup.events({
@ -702,6 +706,12 @@ Template.cardDetailsActionsPopup.events({
if (!err && ret) Popup.close();
});
},
'click .js-toggle-show-list-on-minicard'() {
const currentCard = this;
const newValue = !currentCard.showListOnMinicard;
Cards.update(currentCard._id, { $set: { showListOnMinicard: newValue } });
Popup.close();
},
});
BlazeComponent.extendComponent({

View file

@ -588,3 +588,18 @@
transform: scale(1.02);
transition: all 0.2s ease;
}
/* List name display on minicard */
.minicard-list-name {
font-size: 0.75em;
color: #8c8c8c;
margin-top: 0.2vh;
display: flex;
align-items: center;
gap: 0.3vw;
}
.minicard-list-name i.fa {
font-size: 0.8em;
opacity: 0.7;
}

View file

@ -72,6 +72,10 @@ template(name="minicard")
span.card-number
| ##{getCardNumber}
= getTitle
if shouldShowListOnMinicard
.minicard-list-name
i.fa.fa-list
| {{ listName }}
if $eq 'subtext-with-full-path' currentBoard.presentParentTask
.parent-subtext
| {{ parentString ' > ' }}

View file

@ -196,6 +196,17 @@ Template.minicard.helpers({
},
uploadCount() {
return uploadProgressManager.getUploadCountForCard(this._id);
},
listName() {
const list = this.list();
return list ? list.title : '';
},
shouldShowListOnMinicard() {
// Show list name if either:
// 1. Board-wide setting is enabled, OR
// 2. This specific card has the setting enabled
return this.currentBoard.allowsShowListsOnMinicard || this.showListOnMinicard;
}
});

View file

@ -284,6 +284,12 @@ template(name="boardCardSettingsPopup")
span
i.fa.fa-tags
| {{_ 'labels'}}
div.check-div
a.flex.js-field-has-card-show-lists-on-minicard(class="{{#if allowsShowListsOnMinicard}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsShowListsOnMinicard}}is-checked{{/if}}")
span
i.fa.fa-list
| {{_ 'card-show-lists-on-minicard'}}
div.check-div
a.flex.js-field-has-card-number(class="{{#if allowsCardNumber}}is-checked{{/if}}")
.materialCheckBox(class="{{#if allowsCardNumber}}is-checked{{/if}}")

View file

@ -996,10 +996,15 @@ BlazeComponent.extendComponent({
return this.currentBoard.allowsShowLists;
},
allowsLabels() {
return this.currentBoard.allowsLabels;
},
allowsShowListsOnMinicard() {
return this.currentBoard.allowsShowListsOnMinicard;
},
allowsChecklists() {
return this.currentBoard.allowsChecklists;
},
@ -1282,13 +1287,29 @@ BlazeComponent.extendComponent({
this.currentBoard.setAllowsLabels(this.currentBoard.allowsLabels);
$(`.js-field-has-labels ${MCB}`).toggleClass(
CKCLS,
this.currentBoard.allowsAssignee,
this.currentBoard.allowsLabels,
);
$('.js-field-has-labels').toggleClass(
CKCLS,
this.currentBoard.allowsLabels,
);
},
'click .js-field-has-card-show-lists-on-minicard'(evt) {
evt.preventDefault();
this.currentBoard.allowsShowListsOnMinicard = !this.currentBoard
.allowsShowListsOnMinicard;
this.currentBoard.setAllowsShowListsOnMinicard(
this.currentBoard.allowsShowListsOnMinicard,
);
$(`.js-field-has-card-show-lists-on-minicard ${MCB}`).toggleClass(
CKCLS,
this.currentBoard.allowsShowListsOnMinicard,
);
$('.js-field-has-card-show-lists-on-minicard').toggleClass(
CKCLS,
this.currentBoard.allowsShowListsOnMinicard,
);
},
'click .js-field-has-description-title'(evt) {
evt.preventDefault();
this.currentBoard.allowsDescriptionTitle = !this.currentBoard