improvements

This commit is contained in:
Kevin Papst
2016-10-24 00:06:46 +02:00
parent 8940b766b6
commit b72fd888b1
18 changed files with 514 additions and 258 deletions

View File

@@ -22,22 +22,23 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
* Controller used for manage timesheet entries in the admin part of the site.
*
* @Route("/admin/timesheet")
* @Security("has_role('ROLE_CUSTOMER')")
* @Security("has_role('ROLE_ADMIN')")
*
* @author Kevin Papst <kevin@kevinpapst.de>
*/
class TimesheetController extends Controller
{
/**
* @Route("/", defaults={"page": 1}, name="admin_timesheet_index")
* @Route("/timesheet/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_index_paginated")
* @Route("/", defaults={"page": 1}, name="admin_timesheet")
* @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_timesheet_paginated")
* @Method("GET")
* @Cache(smaxage="10")
*/
public function indexAction($page)
{
/* @var $entries Pagerfanta */
$entries = $this->getDoctrine()->getRepository(Timesheet::class)->findAll($page);
return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]);
return $this->render('TimesheetBundle:admin:timesheet.html.twig', ['entries' => $entries]);
}
}