mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Wire up admin
view properly
This commit is contained in:
parent
7e1651a36e
commit
043e522f39
4 changed files with 12 additions and 5 deletions
|
@ -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) {
|
||||||
|
|
6
app/assets/javascripts/admin/views/admin.js.es6
Normal file
6
app/assets/javascripts/admin/views/admin.js.es6
Normal file
|
@ -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 a new issue