FEATURE: adds a /admin/reports route to list all reports

This commit is contained in:
Joffrey JAFFEUX
2018-06-18 12:31:56 +02:00
committed by GitHub
parent 4b604b1e68
commit f2dbe66367
14 changed files with 129 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
import { ajax } from "discourse/lib/ajax";
export default Discourse.Route.extend({
model() {
return ajax("/admin/reports").then(json => {
return json;
});
},
setupController(controller, model) {
controller.setProperties({ model: model.reports });
}
});

View File

@@ -19,7 +19,7 @@ export default Discourse.Route.extend({
);
},
setupController: function(controller, model) {
setupController(controller, model) {
controller.setProperties({
model: model,
categoryId: model.get("category_id") || "all",

View File

@@ -95,10 +95,13 @@ export default function() {
}
);
this.route("adminReports", {
path: "/reports/:type",
resetNamespace: true
});
this.route(
"adminReports",
{ path: "/reports", resetNamespace: true },
function() {
this.route("show", { path: ":type" });
}
);
this.route(
"adminFlags",