mirror of
https://github.com/discourse/discourse.git
synced 2025-02-26 15:35:25 +08:00

- moderation tab - sorting/pagination - improved third party reports support - trending charts - better perf - many fixes - refactoring - new reports Co-Authored-By: Simon Cossar <scossar@users.noreply.github.com>
155 lines
4.6 KiB
Handlebars
155 lines
4.6 KiB
Handlebars
{{#if isEnabled}}
|
|
{{#conditional-loading-section isLoading=isLoading}}
|
|
{{#if showTimeoutError}}
|
|
<div class="alert alert-error">
|
|
{{i18n "admin.dashboard.timeout_error"}}
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if showHeader}}
|
|
<div class="report-header">
|
|
{{#if showTitle}}
|
|
<div class="report-title">
|
|
<h3 class="title">
|
|
{{#if showAllReportsLink}}
|
|
{{#link-to "adminReports" class="all-report-link"}}
|
|
{{i18n "admin.dashboard.all_reports"}}
|
|
{{/link-to}}
|
|
<span class="separator">|</span>
|
|
{{/if}}
|
|
|
|
<a href="{{model.reportUrl}}" class="report-link">
|
|
{{model.title}}
|
|
</a>
|
|
</h3>
|
|
|
|
{{#if model.description}}
|
|
<span class="info" data-tooltip="{{model.description}}">
|
|
{{d-icon "question-circle"}}
|
|
</span>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if showTrend}}
|
|
{{#if model.prev_period}}
|
|
<div class="trend {{model.trend}}">
|
|
<span class="trend-value" title="{{model.trendTitle}}">
|
|
{{#if model.average}}
|
|
{{number model.currentAverage}}{{#if model.percent}}%{{/if}}
|
|
{{else}}
|
|
{{number model.currentTotal noTitle="true"}}{{#if model.percent}}%{{/if}}
|
|
{{/if}}
|
|
</span>
|
|
|
|
{{#if model.trendIcon}}
|
|
{{d-icon model.trendIcon class="trend-icon"}}
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
|
|
{{#if showModes}}
|
|
<ul class="mode-switch">
|
|
{{#each displayedModes as |displayedMode|}}
|
|
<li class="mode">
|
|
{{d-button
|
|
action="changeMode"
|
|
actionParam=displayedMode.mode
|
|
class=displayedMode.cssClass
|
|
icon=displayedMode.icon}}
|
|
</li>
|
|
{{/each}}
|
|
</ul>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
|
|
<div class="report-body">
|
|
{{#unless showTimeoutError}}
|
|
{{#if currentMode}}
|
|
{{component modeComponent model=model options=options}}
|
|
{{/if}}
|
|
{{/unless}}
|
|
|
|
{{#if showFilteringUI}}
|
|
{{#if hasFilteringActions}}
|
|
<div class="report-filters">
|
|
{{#if showDatesOptions}}
|
|
<div class="filtering-control">
|
|
<span class="filtering-label">
|
|
{{i18n 'admin.dashboard.reports.start_date'}}
|
|
</span>
|
|
|
|
<div class="filtering-input">
|
|
{{date-picker-past
|
|
value=startDate
|
|
defaultDate=startDate
|
|
onSelect=onSelectStartDate}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="filtering-control">
|
|
<span class="filtering-label">
|
|
{{i18n 'admin.dashboard.reports.end_date'}}
|
|
</span>
|
|
|
|
<div class="filtering-input">
|
|
{{date-picker-past
|
|
value=endDate
|
|
defaultDate=endDate
|
|
onSelect=onSelectEndDate}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if showCategoryOptions}}
|
|
<div class="filtering-control">
|
|
<div class="filtering-input">
|
|
{{combo-box
|
|
onSelect=onSelectCategory
|
|
filterable=true
|
|
valueAttribute="value"
|
|
content=categoryOptions
|
|
castInteger=true
|
|
value=categoryId}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if showGroupOptions}}
|
|
<div class="filtering-control">
|
|
<div class="filtering-input">
|
|
{{combo-box
|
|
onSelect=onSelectGroup
|
|
castInteger=true
|
|
filterable=true
|
|
valueAttribute="value"
|
|
content=groupOptions
|
|
value=groupId}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
|
|
{{#if showExport}}
|
|
<div class="filtering-control">
|
|
<div class="filtering-input">
|
|
{{d-button class="export-btn" action="exportCsv" label="admin.export_csv.button_text" icon="download"}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
{{/if}}
|
|
</div>
|
|
|
|
{{#if model.relatedReport}}
|
|
{{admin-report dataSourceName=model.relatedReport.type}}
|
|
{{/if}}
|
|
{{/conditional-loading-section}}
|
|
{{else}}
|
|
<div class="alert alert-info">
|
|
{{{i18n disabledLabel}}}
|
|
</div>
|
|
{{/if}}
|