discourse/app/assets/javascripts/admin/routes/admin-logs-staff-action-logs.js
Sam Saffron 83f5f9176b
DEV: only load staff logs when page is visited
Previously we would load admin staff action logs unconditionally as soon
as the controller was instantiated, this is not desirable we only want to
run the query when you visit the route.
2020-04-03 14:13:01 +11:00

30 lines
906 B
JavaScript

import DiscourseRoute from "discourse/routes/discourse";
import showModal from "discourse/lib/show-modal";
export default DiscourseRoute.extend({
// TODO: make this automatic using an `{{outlet}}`
renderTemplate: function() {
this.render("admin/templates/logs/staff-action-logs", {
into: "adminLogs"
});
},
activate() {
let controller = this.controllerFor("admin-logs-staff-action-logs");
if (controller.filters === null) controller.resetFilters();
},
actions: {
showDetailsModal(model) {
showModal("admin-staff-action-log-details", { model, admin: true });
this.controllerFor("modal").set("modalClass", "log-details-modal");
},
showCustomDetailsModal(model) {
let modal = showModal("admin-theme-change", { model, admin: true });
this.controllerFor("modal").set("modalClass", "history-modal");
modal.loadDiff();
}
}
});