From 043e522f390373ec1a375886b29209cfc9803d5a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 20 Feb 2015 12:18:25 -0500 Subject: [PATCH] Wire up `admin` view properly --- app/assets/javascripts/admin/routes/admin_route.js | 4 ---- app/assets/javascripts/admin/routes/admin_user_route.js | 2 +- app/assets/javascripts/admin/views/admin.js.es6 | 6 ++++++ app/assets/javascripts/discourse/ember/resolver.js.es6 | 5 +++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 app/assets/javascripts/admin/views/admin.js.es6 diff --git a/app/assets/javascripts/admin/routes/admin_route.js b/app/assets/javascripts/admin/routes/admin_route.js index 9c8825fa718..dc0c74da147 100644 --- a/app/assets/javascripts/admin/routes/admin_route.js +++ b/app/assets/javascripts/admin/routes/admin_route.js @@ -1,8 +1,4 @@ Discourse.AdminRoute = Discourse.Route.extend({ - renderTemplate: function() { - this.render('admin/templates/admin'); - }, - titleToken: function() { return I18n.t('admin_title'); }, diff --git a/app/assets/javascripts/admin/routes/admin_user_route.js b/app/assets/javascripts/admin/routes/admin_user_route.js index 5f1d4194059..798b2d13d75 100644 --- a/app/assets/javascripts/admin/routes/admin_user_route.js +++ b/app/assets/javascripts/admin/routes/admin_user_route.js @@ -8,7 +8,7 @@ Discourse.AdminUserRoute = Discourse.Route.extend({ }, renderTemplate: function() { - this.render({into: 'admin/templates/admin'}); + this.render({into: 'admin'}); }, afterModel: function(adminUser) { diff --git a/app/assets/javascripts/admin/views/admin.js.es6 b/app/assets/javascripts/admin/views/admin.js.es6 new file mode 100644 index 00000000000..cd0d05107e5 --- /dev/null +++ b/app/assets/javascripts/admin/views/admin.js.es6 @@ -0,0 +1,6 @@ +export default Ember.View.extend({ + _onInsert: function() { + + }.on('didInsertElement') +}); + diff --git a/app/assets/javascripts/discourse/ember/resolver.js.es6 b/app/assets/javascripts/discourse/ember/resolver.js.es6 index d6ce2e21221..f0e091589ca 100644 --- a/app/assets/javascripts/discourse/ember/resolver.js.es6 +++ b/app/assets/javascripts/discourse/ember/resolver.js.es6 @@ -171,6 +171,11 @@ export default Ember.DefaultResolver.extend({ const compTemplate = Ember.TEMPLATES['admin/templates/' + decamelized]; if (compTemplate) { return compTemplate; } } + + if (decamelized === "javascripts/admin") { + return Ember.TEMPLATES['admin/templates/admin']; + } + if (decamelized.indexOf('admin') === 0 || decamelized.indexOf('javascripts/admin') === 0) { decamelized = decamelized.replace(/^admin\_/, 'admin/templates/'); decamelized = decamelized.replace(/^admin\./, 'admin/templates/');