Skip to content

Commit b6625fc

Browse files
committed
improve backlog math
1 parent d7f1b1f commit b6625fc

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
------------------
33

44
- search improvements [amleczko]
5+
- fix backlog math [amleczko]
56

67

78
1.7.6 (2013-05-08)

por/dashboard/static/por_backlog/backlog.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ $(document).ready(function(){
142142
matching_crs += 1;
143143
}
144144
});
145-
if (percentages.length){
146-
total_percentage = (percentages.reduce(function(a, b) { return a + b }) / percentages.length);
147-
} else {
148-
total_percentage = -1;
145+
if (total_done > 0 && total_estimate > 0){
146+
total_percentage = (total_done / total_estimate) * 100;
147+
}
148+
else {
149+
total_percentage = 0;
149150
}
150-
151151
fill_duration($bgb_header.find('.total-estimate'), total_estimate);
152152
fill_duration($bgb_header.find('.total-done'), total_done);
153153
fill_percentage($bgb_header.find('.total-percentage'), total_percentage);

0 commit comments

Comments
 (0)