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
|
i.fa.fa-plus
|
||||||
|
|
||||||
template(name='checklistItemDetail')
|
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")
|
role="checkbox" aria-checked="{{#if item.isFinished }}true{{else}}false{{/if}}" tabindex="0")
|
||||||
if canModifyCard
|
if canModifyCard
|
||||||
.check-box-container
|
.check-box-container
|
||||||
|
@ -157,6 +157,15 @@ template(name="checklistActionsPopup")
|
||||||
else
|
else
|
||||||
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems_{{checklist._id}}")
|
input.toggle-switch(type="checkbox" id="toggleHideCheckedChecklistItems_{{checklist._id}}")
|
||||||
label.toggle-label(for="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")
|
template(name="copyChecklistPopup")
|
||||||
+copyAndMoveChecklist
|
+copyAndMoveChecklist
|
||||||
|
|
|
@ -317,6 +317,11 @@ BlazeComponent.extendComponent({
|
||||||
this.data().checklist.toggleHideCheckedChecklistItems();
|
this.data().checklist.toggleHideCheckedChecklistItems();
|
||||||
Popup.back();
|
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",
|
"import-board-zip": "Add .zip file that has board JSON files, and board name subdirectories with attachments",
|
||||||
"collapse": "Collapse",
|
"collapse": "Collapse",
|
||||||
"uncollapse": "Uncollapse",
|
"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,
|
type: Boolean,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
hideAllChecklistItems: {
|
||||||
|
/**
|
||||||
|
* hide all checklist items ?
|
||||||
|
*/
|
||||||
|
type: Boolean,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -123,7 +130,11 @@ Checklists.helpers({
|
||||||
return ret;
|
return ret;
|
||||||
},
|
},
|
||||||
isFinished() {
|
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) {
|
showChecklist(hideFinishedChecklistIfItemsAreHidden) {
|
||||||
let ret = true;
|
let ret = true;
|
||||||
|
@ -212,6 +223,13 @@ Checklists.mutations({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
toggleHideAllChecklistItems() {
|
||||||
|
return {
|
||||||
|
$set: {
|
||||||
|
hideAllChecklistItems: !this.hideAllChecklistItems,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Meteor.isServer) {
|
if (Meteor.isServer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue