discourse/app/assets/javascripts/admin/templates/components/admin-report-table.hbs
Joffrey JAFFEUX f9648de897
DEV: upgrades from Ember 2.13 to Ember 3.5.1 (#6808)
Co-Authored-By: Bianca Nenciu <nbianca@users.noreply.github.com>
Co-Authored-By: David Taylor <david@taylorhq.com>
2019-01-10 11:06:01 +01:00

63 lines
1.7 KiB
Handlebars

<table class="table">
<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|}}
{{admin-report-table-row data=data labels=model.computedLabels options=options}}
{{/each}}
{{#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">
{{#each totalsForSample as |total|}}
<td class="admin-report-table-cell {{total.type}} {{total.property}}">
{{total.formatedValue}}
</td>
{{/each}}
</tr>
{{/if}}
{{#if showTotal}}
<tr class="total-row">
<td colspan="2">
{{i18n 'admin.dashboard.reports.total'}}
</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 model.total}}</td>
</tr>
{{/if}}
</tbody>
</table>
<div class="pagination">
{{#each pages as |pageState|}}
{{d-button
translatedLabel=pageState.page
action=(action "changePage")
actionParam=pageState.index
class=pageState.class}}
{{/each}}
</div>