discourse/app/assets/javascripts/admin/routes/admin_site_settings_route.js

28 lines
767 B
JavaScript
Raw Normal View History

/**
Handles routes related to viewing and editing site settings.
@class AdminSiteSettingsRoute
@extends Discourse.Route
@namespace Discourse
@module Discourse
**/
Discourse.AdminSiteSettingsRoute = Discourse.Route.extend({
model: function() {
return Discourse.SiteSetting.findAll();
},
afterModel: function(siteSettings) {
this.controllerFor('adminSiteSettings').set('allSiteSettings', siteSettings);
}
});
2013-11-13 14:02:47 -05:00
/**
Handles when you click the Site Settings tab in admin, but haven't
chosen a category. It will redirect to the first category.
**/
Discourse.AdminSiteSettingsIndexRoute = Discourse.Route.extend({
model: function() {
this.replaceWith('adminSiteSettingsCategory', this.modelFor('adminSiteSettings')[0].nameKey);
2013-11-13 14:02:47 -05:00
}
});