mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
hide empty checklist if checklist items are hidden
conditions are: - the checklist must have at least 1 checklist item - all checklist items have to be finished - the option "hide checked checklist items" is set at card details
This commit is contained in:
parent
9fa36c3991
commit
8448068d22
2 changed files with 9 additions and 1 deletions
|
@ -20,7 +20,8 @@ template(name="checklists")
|
|||
|
||||
.card-checklist-items
|
||||
each checklist in checklists
|
||||
+checklistDetail(checklist = checklist card = card)
|
||||
if checklist.showChecklist card.hideCheckedChecklistItems
|
||||
+checklistDetail(checklist = checklist card = card)
|
||||
|
||||
if canModifyCard
|
||||
+inlinedForm(autoclose=false classNames="js-add-checklist" cardId = cardId)
|
||||
|
|
|
@ -118,6 +118,13 @@ Checklists.helpers({
|
|||
isFinished() {
|
||||
return 0 !== this.itemCount() && this.itemCount() === this.finishedCount();
|
||||
},
|
||||
showChecklist(hideCheckedChecklistItems) {
|
||||
let ret = true;
|
||||
if (this.isFinished() && hideCheckedChecklistItems === true) {
|
||||
ret = false;
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
checkAllItems() {
|
||||
const checkItems = ReactiveCache.getChecklistItems({ checklistId: this._id });
|
||||
checkItems.forEach(function(item) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue