mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 18:23:39 +08:00
1c87bb7fe9
1. Use `this.` instead of `{{action}}` where applicable 2. Use `{{fn}}` instead of `@actionParam` where applicable 3. Use non-`@` versions of class/type/tabindex/aria-controls/aria-expanded 4. Remove `btn` class (it's added automatically to all DButtons) 5. Remove `type="button"` (it's the default) 6. Use `concat-class` helper
83 lines
2.3 KiB
Handlebars
83 lines
2.3 KiB
Handlebars
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
{{#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}}
|
|
/>
|
|
{{/each}}
|
|
{{else}}
|
|
{{#each this.model.data as |data|}}
|
|
<th>{{data.x}}</th>
|
|
{{/each}}
|
|
{{/if}}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{#each this.paginatedData as |data|}}
|
|
<AdminReportTableRow
|
|
@data={{data}}
|
|
@labels={{this.model.computedLabels}}
|
|
@options={{this.options}}
|
|
/>
|
|
{{/each}}
|
|
|
|
{{#if this.showTotalForSample}}
|
|
<tr class="total-row">
|
|
<td colspan={{this.totalsForSample.length}}>
|
|
{{i18n "admin.dashboard.reports.totals_for_sample"}}
|
|
</td>
|
|
</tr>
|
|
<tr class="admin-report-table-row">
|
|
{{#each this.totalsForSample as |total|}}
|
|
<td class="admin-report-table-cell {{total.type}} {{total.property}}">
|
|
{{total.formattedValue}}
|
|
</td>
|
|
{{/each}}
|
|
</tr>
|
|
{{/if}}
|
|
|
|
{{#if this.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
|
|
this.model.total
|
|
}}</td>
|
|
</tr>
|
|
{{/if}}
|
|
|
|
{{#if this.showAverage}}
|
|
<tr class="total-row">
|
|
<td colspan="2">
|
|
{{i18n "admin.dashboard.reports.average_for_sample"}}
|
|
</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
|
|
this.averageForSample
|
|
}}</td>
|
|
</tr>
|
|
{{/if}}
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="pagination">
|
|
{{#each this.pages as |pageState|}}
|
|
<DButton
|
|
@translatedLabel={{pageState.page}}
|
|
@action={{fn this.changePage pageState.index}}
|
|
class={{pageState.class}}
|
|
/>
|
|
{{/each}}
|
|
</div> |