mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 01:08:35 +08:00
FEATURE: displays average for 2 columns tables which support average
This commit is contained in:
@ -31,6 +31,16 @@ export default Ember.Component.extend({
|
||||
return reportTotal && total && twoColumns;
|
||||
},
|
||||
|
||||
@computed("model.average", "totalsForSample.1.value", "twoColumns")
|
||||
showAverage(reportAverage, totalValue, twoColumns) {
|
||||
return reportAverage && totalValue && twoColumns;
|
||||
},
|
||||
|
||||
@computed("totalsForSample.1.value", "model.data.length")
|
||||
averageForSample(totals, count) {
|
||||
return (totals / count).toFixed(0);
|
||||
},
|
||||
|
||||
@computed("model.data.length")
|
||||
showSortingUI(dataLength) {
|
||||
return dataLength >= 5;
|
||||
|
Reference in New Issue
Block a user