Wire up `admin` view properly
This commit is contained in:
parent
7e1651a36e
commit
043e522f39
|
@ -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');
|
||||||
},
|
},
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
export default Ember.View.extend({
|
||||||
|
_onInsert: function() {
|
||||||
|
|
||||||
|
}.on('didInsertElement')
|
||||||
|
});
|
||||||
|
|
|
@ -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/');
|
||||||
|
|
Loading…
Reference in New Issue