mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
server half of #83, posts are draft by default, browse shows published by default
This commit is contained in:
parent
c55a96083a
commit
b7064185d4
@ -132,12 +132,12 @@
|
||||
}
|
||||
},
|
||||
'content': function (req, res) {
|
||||
api.posts.browse()
|
||||
.then(function (posts) {
|
||||
api.posts.browse({status: req.params.status || 'all'})
|
||||
.then(function (page) {
|
||||
res.render('content', {
|
||||
bodyClass: 'manage',
|
||||
adminNav: setSelected(adminNavbar, 'content'),
|
||||
posts: posts.toJSON()
|
||||
posts: page.posts
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -14,8 +14,8 @@
|
||||
|
||||
frontendControllers = {
|
||||
'homepage': function (req, res) {
|
||||
api.posts.browse().then(function (posts) {
|
||||
ghost.doFilter('prePostsRender', posts.toJSON(), function (posts) {
|
||||
api.posts.browse().then(function (page) {
|
||||
ghost.doFilter('prePostsRender', page.posts, function (posts) {
|
||||
res.render('index', {posts: posts, ghostGlobals: res.locals.ghostGlobals, navItems: res.locals.navItems});
|
||||
});
|
||||
});
|
||||
|
@ -22,7 +22,7 @@
|
||||
// # Posts
|
||||
posts = {
|
||||
// takes filter / pagination parameters
|
||||
// returns a list of posts in a json response
|
||||
// returns a page of posts in a json response
|
||||
browse: function (options) {
|
||||
return dataProvider.Post.findPage(options);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user