2018-08-17 10:19:25 -04:00
|
|
|
<table class="table">
|
2018-07-19 14:33:11 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
{{#if model.computedLabels}}
|
2020-03-09 05:03:46 -04:00
|
|
|
{{#each model.computedLabels as |label|}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminReportTableHeader @showSortingUI={{showSortingUI}} @currentSortDirection={{sortDirection}} @currentSortLabel={{sortLabel}} @label={{label}} @sortByLabel={{action "sortByLabel" label}} />
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
|
|
|
{{#each model.data as |data|}}
|
|
|
|
<th>{{data.x}}</th>
|
|
|
|
{{/each}}
|
|
|
|
{{/if}}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each paginatedData as |data|}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<AdminReportTableRow @data={{data}} @labels={{model.computedLabels}} @options={{options}} />
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
|
2018-07-31 17:35:13 -04:00
|
|
|
{{#if showTotalForSample}}
|
|
|
|
<tr class="total-row">
|
2020-03-07 06:58:48 -05:00
|
|
|
<td colspan={{totalsForSample.length}}>
|
2018-07-31 17:35:13 -04:00
|
|
|
{{i18n "admin.dashboard.reports.totals_for_sample"}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="admin-report-table-row">
|
2018-07-19 14:33:11 -04:00
|
|
|
{{#each totalsForSample as |total|}}
|
2018-08-17 10:19:25 -04:00
|
|
|
<td class="admin-report-table-cell {{total.type}} {{total.property}}">
|
2022-06-20 14:02:05 -04:00
|
|
|
{{total.formattedValue}}
|
2018-07-31 17:35:13 -04:00
|
|
|
</td>
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
</tr>
|
2018-07-31 17:35:13 -04:00
|
|
|
{{/if}}
|
2018-07-19 14:33:11 -04:00
|
|
|
|
2018-07-31 17:35:13 -04:00
|
|
|
{{#if showTotal}}
|
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
|
|
|
{{i18n "admin.dashboard.reports.total"}}
|
|
|
|
</td>
|
2018-07-19 14:33:11 -04:00
|
|
|
</tr>
|
2018-07-31 17:35:13 -04:00
|
|
|
<tr class="admin-report-table-row">
|
2018-08-17 10:19:25 -04:00
|
|
|
<td class="admin-report-table-cell date x">—</td>
|
|
|
|
<td class="admin-report-table-cell number y">{{number model.total}}</td>
|
2018-07-31 17:35:13 -04:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2019-06-04 05:08:26 -04:00
|
|
|
|
|
|
|
{{#if showAverage}}
|
|
|
|
<tr class="total-row">
|
|
|
|
<td colspan="2">
|
2019-06-04 05:22:44 -04:00
|
|
|
{{i18n "admin.dashboard.reports.average_for_sample"}}
|
2019-06-04 05:08:26 -04:00
|
|
|
</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-07-31 17:35:13 -04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-07-19 14:33:11 -04:00
|
|
|
|
|
|
|
<div class="pagination">
|
|
|
|
{{#each pages as |pageState|}}
|
2022-06-30 06:30:50 -04:00
|
|
|
<DButton @translatedLabel={{pageState.page}} @action={{action "changePage"}} @actionParam={{pageState.index}} @class={{pageState.class}} />
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
</div>
|