mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
424a3b042a
REFACTOR: ES6ified all the modals
26 lines
836 B
JavaScript
26 lines
836 B
JavaScript
import showModal from 'discourse/lib/show-modal';
|
|
|
|
export default Discourse.Route.extend({
|
|
// TODO: make this automatic using an `{{outlet}}`
|
|
renderTemplate: function() {
|
|
this.render('admin/templates/logs/staff_action_logs', {into: 'adminLogs'});
|
|
},
|
|
|
|
setupController: function(controller) {
|
|
controller.resetFilters();
|
|
controller.refresh();
|
|
},
|
|
|
|
actions: {
|
|
showDetailsModal(logRecord) {
|
|
showModal('modals/admin-staff-action-log-details', logRecord);
|
|
this.controllerFor('modal').set('modalClass', 'log-details-modal');
|
|
},
|
|
|
|
showCustomDetailsModal(logRecord) {
|
|
const modalName = "modals/" + (logRecord.action_name + '_details').replace("_", "-");
|
|
showModal(modalName, logRecord);
|
|
this.controllerFor('modal').set('modalClass', 'tabbed-modal log-details-modal');
|
|
}
|
|
}
|
|
});
|