From d4562816686bba9a047f9efa3f259b5bd8abbc62 Mon Sep 17 00:00:00 2001 From: Harry Wolff Date: Wed, 26 Feb 2014 23:45:45 -0500 Subject: [PATCH] Move Ember Admin to use es6 modules - adds required dependencies to package.json and to bower.json - added required Grunt tasks to transpile and concat ember admin files --- ghost/admin/app.js | 8 ++++++-- ghost/admin/router.js | 14 ++++++++------ ghost/admin/templates/index.hbs | 1 + 3 files changed, 15 insertions(+), 8 deletions(-) create mode 100755 ghost/admin/templates/index.hbs diff --git a/ghost/admin/app.js b/ghost/admin/app.js index b4c353615a..56c0cb68d1 100755 --- a/ghost/admin/app.js +++ b/ghost/admin/app.js @@ -1,6 +1,8 @@ /*global Ember */ -var App = Ember.Application.create({ +import Resolver from 'ember/resolver'; + +var App = Ember.Application.extend({ /** * These are debugging flags, they are useful during development */ @@ -9,6 +11,8 @@ var App = Ember.Application.create({ LOG_TRANSITIONS: true, LOG_TRANSITIONS_INTERNAL: true, LOG_VIEW_LOOKUPS: true, - rootElement: '#ember-app' // tells ember to inject this app into element with selector #ember-app + modulePrefix: 'ghost', // TODO: loaded via config + Resolver: Resolver['default'] }); +export default App; diff --git a/ghost/admin/router.js b/ghost/admin/router.js index 1133384526..76a432d973 100755 --- a/ghost/admin/router.js +++ b/ghost/admin/router.js @@ -1,9 +1,11 @@ -/*global App */ +/*global Ember */ -App.Router.map(function () { +// ensure we don't share routes between all Router instances +var Router = Ember.Router.extend(); + +Router.map(function () { 'use strict'; - this.resource('posts'); - this.resource('post', {path: 'post/:id'}, function () { - this.route('edit'); - }); + }); + +export default Router; diff --git a/ghost/admin/templates/index.hbs b/ghost/admin/templates/index.hbs new file mode 100755 index 0000000000..b19c2990f7 --- /dev/null +++ b/ghost/admin/templates/index.hbs @@ -0,0 +1 @@ +This is the index route \ No newline at end of file