parent
9d97e1244e
commit
5f54b005a1
|
@ -1,13 +1,17 @@
|
|||
import { ajax } from 'discourse/lib/ajax';
|
||||
import round from "discourse/lib/round";
|
||||
import { fmt } from 'discourse/lib/computed';
|
||||
import { fillMissingDates } from 'discourse/lib/utilities';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const Report = Discourse.Model.extend({
|
||||
average: false,
|
||||
|
||||
reportUrl: fmt("type", "/admin/reports/%@"),
|
||||
@computed("type", "start_date", "end_date")
|
||||
reportUrl(type, start_date, end_date) {
|
||||
start_date = moment(start_date).format("YYYY-MM-DD");
|
||||
end_date = moment(end_date).format("YYYY-MM-DD");
|
||||
return Discourse.getURL(`/admin/reports/${type}?start_date=${start_date}&end_date=${end_date}`);
|
||||
},
|
||||
|
||||
valueAt(numDaysAgo) {
|
||||
if (this.data) {
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
{{#conditional-loading-section isLoading=isLoading title=report.title}}
|
||||
<div class="chart-title">
|
||||
<h3 title={{report.description}}>
|
||||
{{report.title}}
|
||||
|
||||
{{#if report.description}}
|
||||
{{d-icon "question-circle"}}
|
||||
{{/if}}
|
||||
<a href="{{report.reportUrl}}">
|
||||
{{report.title}}
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<div class="chart-trend {{trend}}">
|
||||
|
|
|
@ -182,6 +182,9 @@
|
|||
|
||||
h3 {
|
||||
margin: 1em 0;
|
||||
a, a:visited {
|
||||
color: $primary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue