mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 16:00:13 +01:00
parent
61dd3180a4
commit
ac1f540763
4 changed files with 32 additions and 0 deletions
|
|
@ -43,6 +43,8 @@ template(name="checklistDetail")
|
||||||
h2.title
|
h2.title
|
||||||
+viewer
|
+viewer
|
||||||
= checklist.title
|
= checklist.title
|
||||||
|
.checklist-progress-bar
|
||||||
|
.checklist-progress(style="width:{{finishedPercent}}%") {{finishedPercent}}%
|
||||||
+checklistItems(checklist = checklist)
|
+checklistItems(checklist = checklist)
|
||||||
|
|
||||||
template(name="checklistDeletePopup")
|
template(name="checklistDeletePopup")
|
||||||
|
|
|
||||||
|
|
@ -77,6 +77,12 @@ BlazeComponent.extendComponent({
|
||||||
!Meteor.user().isWorker()
|
!Meteor.user().isWorker()
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** returns the finished percent of the checklist */
|
||||||
|
finishedPercent() {
|
||||||
|
const ret = this.data().checklist.finishedPercent();
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
}).register('checklistDetail');
|
}).register('checklistDetail');
|
||||||
|
|
||||||
BlazeComponent.extendComponent({
|
BlazeComponent.extendComponent({
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,17 @@ textarea.js-add-checklist-item, textarea.js-edit-checklist-item
|
||||||
display: flex
|
display: flex
|
||||||
justify-content: space-between
|
justify-content: space-between
|
||||||
|
|
||||||
|
.checklist-progress-bar
|
||||||
|
width: 90%
|
||||||
|
height: 20px
|
||||||
|
|
||||||
|
.checklist-progress
|
||||||
|
color: #fff !important
|
||||||
|
background-color: #2196F3 !important
|
||||||
|
padding: 0.01em 16px
|
||||||
|
border-radius: 16px
|
||||||
|
height: 100%
|
||||||
|
|
||||||
.checklist-title
|
.checklist-title
|
||||||
.checkbox
|
.checkbox
|
||||||
float: left
|
float: left
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,19 @@ Checklists.helpers({
|
||||||
isFinished: true,
|
isFinished: true,
|
||||||
}).count();
|
}).count();
|
||||||
},
|
},
|
||||||
|
/** returns the finished percent of the checklist */
|
||||||
|
finishedPercent() {
|
||||||
|
const checklistItems = ChecklistItems.find({ checklistId: this._id });
|
||||||
|
const count = checklistItems.count();
|
||||||
|
const checklistItemsFinished = checklistItems.fetch().filter(checklistItem => checklistItem.isFinished);
|
||||||
|
|
||||||
|
let ret = 0;
|
||||||
|
|
||||||
|
if (count > 0) {
|
||||||
|
ret = Math.round(checklistItemsFinished.length / count * 100);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
},
|
||||||
isFinished() {
|
isFinished() {
|
||||||
return 0 !== this.itemCount() && this.itemCount() === this.finishedCount();
|
return 0 !== this.itemCount() && this.itemCount() === this.finishedCount();
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue