mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Checklist, hide all checklist items possible, regardless if the checklist item is finished or not
This commit is contained in:
parent
bb17feaa17
commit
0783b733b0
4 changed files with 36 additions and 3 deletions
|
@ -120,7 +120,7 @@ template(name="checklistItems")
|
|||
i.fa.fa-plus
|
||||
|
||||
template(name='checklistItemDetail')
|
||||
.js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if checklist.hideCheckedChecklistItems}} invisible{{/if}}{{/if}}"
|
||||
.js-checklist-item.checklist-item(class="{{#if item.isFinished }}is-checked{{#if checklist.hideCheckedChecklistItems}} invisible{{/if}}{{/if}}{{#if checklist.hideAllChecklistItems}} is-checked invisible{{/if}}"
|
||||
role="checkbox" aria-checked="{{#if item.isFinished }}true{{else}}false{{/if}}" tabindex="0")
|
||||
if canModifyCard
|
||||
.check-box-container
|
||||
|
@ -157,6 +157,15 @@ template(name="checklistActionsPopup")
|
|||
else
|
||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems_{{checklist._id}}")
|
||||
label.toggle-label(for="toggleHideCheckedChecklistItems_{{checklist._id}}")
|
||||
a.js-hide-all-checklist-items
|
||||
i.fa.fa-ban
|
||||
| {{_ "hideAllChecklistItems"}} ...
|
||||
.material-toggle-switch(title="{{_ 'hideAllChecklistItems'}}")
|
||||
if checklist.hideAllChecklistItems
|
||||
input.toggle-switch(type="checkbox" id="toggleHideAllChecklistItems_{{checklist._id}}" checked="checked")
|
||||
else
|
||||
input.toggle-switch(type="checkbox" id="toggleHideAllChecklistItems_{{checklist._id}}")
|
||||
label.toggle-label(for="toggleHideAllChecklistItems_{{checklist._id}}")
|
||||
|
||||
template(name="copyChecklistPopup")
|
||||
+copyAndMoveChecklist
|
||||
|
|
|
@ -317,6 +317,11 @@ BlazeComponent.extendComponent({
|
|||
this.data().checklist.toggleHideCheckedChecklistItems();
|
||||
Popup.back();
|
||||
},
|
||||
'click .js-hide-all-checklist-items'(event) {
|
||||
event.preventDefault();
|
||||
this.data().checklist.toggleHideAllChecklistItems();
|
||||
Popup.back();
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1253,5 +1253,6 @@
|
|||
"import-board-zip": "Add .zip file that has board JSON files, and board name subdirectories with attachments",
|
||||
"collapse": "Collapse",
|
||||
"uncollapse": "Uncollapse",
|
||||
"hideCheckedChecklistItems": "Hide checked checklist items"
|
||||
"hideCheckedChecklistItems": "Hide checked checklist items",
|
||||
"hideAllChecklistItems": "Hide all checklist items"
|
||||
}
|
||||
|
|
|
@ -70,6 +70,13 @@ Checklists.attachSchema(
|
|||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
hideAllChecklistItems: {
|
||||
/**
|
||||
* hide all checklist items ?
|
||||
*/
|
||||
type: Boolean,
|
||||
optional: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
|
@ -123,7 +130,11 @@ Checklists.helpers({
|
|||
return ret;
|
||||
},
|
||||
isFinished() {
|
||||
return 0 !== this.itemCount() && this.itemCount() === this.finishedCount();
|
||||
let ret = this.hideAllChecklistItems;
|
||||
if (!ret) {
|
||||
ret = 0 !== this.itemCount() && this.itemCount() === this.finishedCount();
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
showChecklist(hideFinishedChecklistIfItemsAreHidden) {
|
||||
let ret = true;
|
||||
|
@ -212,6 +223,13 @@ Checklists.mutations({
|
|||
}
|
||||
};
|
||||
},
|
||||
toggleHideAllChecklistItems() {
|
||||
return {
|
||||
$set: {
|
||||
hideAllChecklistItems: !this.hideAllChecklistItems,
|
||||
}
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
if (Meteor.isServer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue