2018-08-17 22:19:25 +08:00
|
|
|
<table class="table">
|
2018-07-20 02:33:11 +08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
{{#if model.computedLabels}}
|
|
|
|
{{#each model.computedLabels as |label index|}}
|
|
|
|
{{admin-report-table-header
|
|
|
|
showSortingUI=showSortingUI
|
|
|
|
currentSortDirection=sortDirection
|
|
|
|
currentSortLabel=sortLabel
|
|
|
|
label=label
|
|
|
|
sortByLabel=(action "sortByLabel" label)}}
|
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
|
|
|
{{#each model.data as |data|}}
|
|
|
|
<th>{{data.x}}</th>
|
|
|
|
{{/each}}
|
|
|
|
{{/if}}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each paginatedData as |data|}}
|
2018-08-02 06:40:59 +08:00
|
|
|
{{admin-report-table-row data=data labels=model.computedLabels options=options}}
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
|
2018-08-01 05:35:13 +08:00
|
|
|
{{#if showTotalForSample}}
|
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="{{totalsForSample.length}}">
|
|
|
|
{{i18n 'admin.dashboard.reports.totals_for_sample'}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="admin-report-table-row">
|
2018-07-20 02:33:11 +08:00
|
|
|
{{#each totalsForSample as |total|}}
|
2018-08-17 22:19:25 +08:00
|
|
|
<td class="admin-report-table-cell {{total.type}} {{total.property}}">
|
2018-08-01 05:35:13 +08:00
|
|
|
{{total.formatedValue}}
|
|
|
|
</td>
|
2018-07-20 02:33:11 +08:00
|
|
|
{{/each}}
|
|
|
|
</tr>
|
2018-08-01 05:35:13 +08:00
|
|
|
{{/if}}
|
2018-07-20 02:33:11 +08:00
|
|
|
|
2018-08-01 05:35:13 +08:00
|
|
|
{{#if showTotal}}
|
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
|
|
|
{{i18n 'admin.dashboard.reports.total'}}
|
|
|
|
</td>
|
2018-07-20 02:33:11 +08:00
|
|
|
</tr>
|
2018-08-01 05:35:13 +08:00
|
|
|
<tr class="admin-report-table-row">
|
2018-08-17 22:19:25 +08:00
|
|
|
<td class="admin-report-table-cell date x">—</td>
|
|
|
|
<td class="admin-report-table-cell number y">{{number model.total}}</td>
|
2018-08-01 05:35:13 +08:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2019-06-04 17:08:26 +08:00
|
|
|
|
|
|
|
{{#if showAverage}}
|
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
|
|
|
{{i18n 'admin.dashboard.reports.average'}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="admin-report-table-row">
|
|
|
|
<td class="admin-report-table-cell date x">—</td>
|
|
|
|
<td class="admin-report-table-cell number y">{{number averageForSample}}</td>
|
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2018-08-01 05:35:13 +08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-07-20 02:33:11 +08:00
|
|
|
|
|
|
|
<div class="pagination">
|
|
|
|
{{#each pages as |pageState|}}
|
|
|
|
{{d-button
|
|
|
|
translatedLabel=pageState.page
|
2019-01-10 18:06:01 +08:00
|
|
|
action=(action "changePage")
|
2018-07-20 02:33:11 +08:00
|
|
|
actionParam=pageState.index
|
|
|
|
class=pageState.class}}
|
|
|
|
{{/each}}
|
|
|
|
</div>
|