Skip to content

Commit

Permalink
feature #381 Ensure default Post sort order shows newer Posts first (…
Browse files Browse the repository at this point in the history
…simensen)

This PR was merged into the master branch.

Discussion
----------

Ensure default Post sort order shows newer Posts first

In at least #223 the topic of sorting on the **admin backend** was mentioned. This is the first time I've loaded the demo app in quite awhile and wasn't sure it was working because I didn't realize the new post I had added was going to show up at the bottom of the list. It may not be a problem for everyone but the bottom of the list on my laptop was well past the fold.

I appreciate that we do not need to make this **admin backend** fully completed with pagination and column-by-column sorting and what-not. However, I think it would make sense to have newer posts showing up at the top.

Commits
-------

87584a6 Ensure default Post sort order shows newer Posts first
  • Loading branch information
javiereguiluz committed Oct 5, 2016
2 parents eaf516c + 87584a6 commit 89352e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/AppBundle/Controller/Admin/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class BlogController extends Controller
public function indexAction()
{
$entityManager = $this->getDoctrine()->getManager();
$posts = $entityManager->getRepository(Post::class)->findAll();
$posts = $entityManager->getRepository(Post::class)->findBy([], ['publishedAt' => 'DESC']);

return $this->render('admin/blog/index.html.twig', ['posts' => $posts]);
}
Expand Down

0 comments on commit 89352e8

Please sign in to comment.