mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 23:16:38 +08:00
FEATURE: differentiate total and total for period on admin table report
This commit is contained in:
parent
c2ddad696f
commit
fed86225c8
@ -0,0 +1,9 @@
|
|||||||
|
import computed from "ember-addons/ember-computed-decorators";
|
||||||
|
|
||||||
|
export default Ember.Component.extend({
|
||||||
|
@computed("model.sortedData")
|
||||||
|
totalForPeriod(data) {
|
||||||
|
const values = data.map(d => d.y);
|
||||||
|
return values.reduce((sum, v) => sum + v);
|
||||||
|
}
|
||||||
|
});
|
@ -14,10 +14,19 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
|
<tr class="total-for-period">
|
||||||
|
<td class="x-value">
|
||||||
|
{{i18n 'admin.dashboard.reports.total_for_period'}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{totalForPeriod}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
{{#if model.total}}
|
{{#if model.total}}
|
||||||
<tr class="total-for-period">
|
<tr class="total">
|
||||||
<td class="x-value">
|
<td class="x-value">
|
||||||
{{i18n 'admin.dashboard.reports.total_for_period'}}
|
{{i18n 'admin.dashboard.reports.total'}}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{model.total}}
|
{{model.total}}
|
||||||
|
@ -178,7 +178,8 @@ $mobile-breakpoint: 700px;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.total-for-period {
|
tr.total-for-period,
|
||||||
|
tr.total {
|
||||||
td {
|
td {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
@ -2775,6 +2775,7 @@ en:
|
|||||||
groups: "All groups"
|
groups: "All groups"
|
||||||
disabled: "This report is disabled"
|
disabled: "This report is disabled"
|
||||||
total_for_period: "Total for period"
|
total_for_period: "Total for period"
|
||||||
|
total: "Total"
|
||||||
trending_search:
|
trending_search:
|
||||||
more: '<a href="/admin/logs/search_logs">Search logs</a>'
|
more: '<a href="/admin/logs/search_logs">Search logs</a>'
|
||||||
disabled: 'Trending search report is disabled. Enable <a href="/admin/site_settings/category/all_results?filter=log%20search%20queries">log search queries</a> to collect data.'
|
disabled: 'Trending search report is disabled. Enable <a href="/admin/site_settings/category/all_results?filter=log%20search%20queries">log search queries</a> to collect data.'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user