2015-02-06 17:32:59 -05:00
|
|
|
export default Ember.Route.extend({
|
|
|
|
model() {
|
2015-02-10 12:14:23 -05:00
|
|
|
return this.store.findAll('plugin');
|
2015-02-06 17:32:59 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
actions: {
|
2015-07-02 12:45:17 -04:00
|
|
|
showSettings(plugin) {
|
|
|
|
const controller = this.controllerFor('adminSiteSettings');
|
2015-09-08 13:28:05 -04:00
|
|
|
this.transitionTo('adminSiteSettingsCategory', 'plugins').then(() => {
|
2015-07-02 12:45:17 -04:00
|
|
|
if (plugin) {
|
2018-05-07 22:30:33 -04:00
|
|
|
const siteSettingFilter = plugin.get('enabled_setting_filter');
|
2015-07-02 12:45:17 -04:00
|
|
|
const match = /^(.*)_enabled/.exec(plugin.get('enabled_setting'));
|
2018-05-07 22:30:33 -04:00
|
|
|
const filter = siteSettingFilter || match[1];
|
|
|
|
|
|
|
|
if (filter) {
|
2015-07-02 12:45:17 -04:00
|
|
|
// filterContent() is normally on a debounce from typing.
|
|
|
|
// Because we don't want the default of "All Results", we tell it
|
|
|
|
// to skip the next debounce.
|
2018-05-07 22:30:33 -04:00
|
|
|
controller.set('filter', filter);
|
2015-07-02 12:45:17 -04:00
|
|
|
controller.set('_skipBounce', true);
|
|
|
|
controller.filterContentNow('plugins');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2015-02-06 17:32:59 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|