Wire up admin view properly

This commit is contained in:
Robin Ward 2015-02-20 12:18:25 -05:00
parent 7e1651a36e
commit 043e522f39
4 changed files with 12 additions and 5 deletions

View file

@ -1,8 +1,4 @@
Discourse.AdminRoute = Discourse.Route.extend({ Discourse.AdminRoute = Discourse.Route.extend({
renderTemplate: function() {
this.render('admin/templates/admin');
},
titleToken: function() { titleToken: function() {
return I18n.t('admin_title'); return I18n.t('admin_title');
}, },

View file

@ -8,7 +8,7 @@ Discourse.AdminUserRoute = Discourse.Route.extend({
}, },
renderTemplate: function() { renderTemplate: function() {
this.render({into: 'admin/templates/admin'}); this.render({into: 'admin'});
}, },
afterModel: function(adminUser) { afterModel: function(adminUser) {

View file

@ -0,0 +1,6 @@
export default Ember.View.extend({
_onInsert: function() {
}.on('didInsertElement')
});

View file

@ -171,6 +171,11 @@ export default Ember.DefaultResolver.extend({
const compTemplate = Ember.TEMPLATES['admin/templates/' + decamelized]; const compTemplate = Ember.TEMPLATES['admin/templates/' + decamelized];
if (compTemplate) { return compTemplate; } if (compTemplate) { return compTemplate; }
} }
if (decamelized === "javascripts/admin") {
return Ember.TEMPLATES['admin/templates/admin'];
}
if (decamelized.indexOf('admin') === 0 || decamelized.indexOf('javascripts/admin') === 0) { if (decamelized.indexOf('admin') === 0 || decamelized.indexOf('javascripts/admin') === 0) {
decamelized = decamelized.replace(/^admin\_/, 'admin/templates/'); decamelized = decamelized.replace(/^admin\_/, 'admin/templates/');
decamelized = decamelized.replace(/^admin\./, 'admin/templates/'); decamelized = decamelized.replace(/^admin\./, 'admin/templates/');