2018-08-17 10:19:25 -04:00
|
|
|
<table class="table">
|
2018-07-19 14:33:11 -04:00
|
|
|
<thead>
|
|
|
|
<tr>
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.model.computedLabels}}
|
|
|
|
{{#each this.model.computedLabels as |label|}}
|
|
|
|
<AdminReportTableHeader @showSortingUI={{this.showSortingUI}} @currentSortDirection={{this.sortDirection}} @currentSortLabel={{this.sortLabel}} @label={{label}} @sortByLabel={{action "sortByLabel" label}} />
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.model.data as |data|}}
|
2018-07-19 14:33:11 -04:00
|
|
|
<th>{{data.x}}</th>
|
|
|
|
{{/each}}
|
|
|
|
{{/if}}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.paginatedData as |data|}}
|
|
|
|
<AdminReportTableRow @data={{data}} @labels={{this.model.computedLabels}} @options={{this.options}} />
|
2018-07-19 14:33:11 -04:00
|
|
|
{{/each}}
|
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showTotalForSample}}
|
2018-07-31 17:35:13 -04:00
|
|
|
<tr class="total-row">
|
2022-07-05 13:41:31 -04:00
|
|
|
<td colspan={{this.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">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.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
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showTotal}}
|
2018-07-31 17:35:13 -04:00
|
|
|
<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>
|
2022-07-05 13:41:31 -04:00
|
|
|
<td class="admin-report-table-cell number y">{{number this.model.total}}</td>
|
2018-07-31 17:35:13 -04:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2019-06-04 05:08:26 -04:00
|
|
|
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#if this.showAverage}}
|
2019-06-04 05:08:26 -04:00
|
|
|
<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>
|
2022-07-05 13:41:31 -04:00
|
|
|
<td class="admin-report-table-cell number y">{{number this.averageForSample}}</td>
|
2019-06-04 05:08:26 -04:00
|
|
|
</tr>
|
|
|
|
{{/if}}
|
2018-07-31 17:35:13 -04:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-07-19 14:33:11 -04:00
|
|
|
|
|
|
|
<div class="pagination">
|
2022-07-05 13:41:31 -04:00
|
|
|
{{#each this.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>
|