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