improvements

This commit is contained in:
Kevin Papst
2016-10-23 21:27:11 +02:00
parent c492d30be3
commit 8940b766b6
27 changed files with 728 additions and 138 deletions

View File

@@ -36,7 +36,7 @@ class TimesheetController extends Controller
*/
public function indexAction($page)
{
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($page);
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findAll($page);
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
}

View File

@@ -30,13 +30,14 @@ class TimesheetController extends Controller
{
/**
* @Route("/", defaults={"page": 1}, name="timesheet")
* @Route("/timesheet/{page}", requirements={"page": "[1-9]\d*"}, name="timesheet_paginated")
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="timesheet_paginated")
* @Method("GET")
* @Cache(smaxage="10")
*/
public function indexAction($page)
{
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($page);
$user = $this->getUser();
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page);
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
}