diff --git a/ghost/admin/routes/posts/index.js b/ghost/admin/routes/posts/index.js index 03a49e76d4..194977fe3d 100644 --- a/ghost/admin/routes/posts/index.js +++ b/ghost/admin/routes/posts/index.js @@ -2,7 +2,7 @@ import AuthenticatedRoute from 'ghost/routes/authenticated'; import loadingIndicator from 'ghost/mixins/loading-indicator'; var PostsIndexRoute = AuthenticatedRoute.extend(loadingIndicator, { - // redirect to first post subroute + // redirect to first post subroute unless no posts exist beforeModel: function () { var self = this; @@ -11,7 +11,10 @@ var PostsIndexRoute = AuthenticatedRoute.extend(loadingIndicator, { staticPages: 'all' }).then(function (records) { var post = records.get('firstObject'); - return self.transitionTo('posts.post', post); + + if (post) { + return self.transitionTo('posts.post', post); + } }); } }); diff --git a/ghost/admin/templates/posts/index.hbs b/ghost/admin/templates/posts/index.hbs new file mode 100644 index 0000000000..56af38ba9c --- /dev/null +++ b/ghost/admin/templates/posts/index.hbs @@ -0,0 +1,6 @@ +
+
+

You Haven't Written Any Posts Yet!

+ {{#link-to "editor.new"}}{{/link-to}} +
+
diff --git a/ghost/admin/templates/posts/post.hbs b/ghost/admin/templates/posts/post.hbs index 1e37caca77..cdf761a84b 100644 --- a/ghost/admin/templates/posts/post.hbs +++ b/ghost/admin/templates/posts/post.hbs @@ -1,21 +1,8 @@ -{{#if title}} +{{partial "floating-header"}} - {{partial "floating-header"}} - - {{#view "content-preview-content-view" tagName="section"}} -
-

{{{title}}}

- {{{html}}} -
- {{/view}} - -{{else}} - -
-
-

You Haven't Written Any Posts Yet!

- {{#link-to "editor.new"}}{{/link-to}} -
+{{#view "content-preview-content-view" tagName="section"}} +
+

{{{title}}}

+ {{{html}}}
- -{{/if}} +{{/view}}