From b72fd888b1596422030e2b1a8783dfa4d4ac635a Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Mon, 24 Oct 2016 00:06:46 +0200 Subject: [PATCH] improvements --- app/Resources/translations/messages.de.xliff | 99 +++++++++- app/Resources/views/bootstrap.html.twig | 2 +- app/Resources/views/dashboard/index.html.twig | 4 +- app/Resources/views/macros/widgets.html.twig | 15 ++ .../Controller/Admin/ActivityController.php | 45 +++++ .../Controller/Admin/ProjectController.php | 46 +++++ .../Controller/Admin/TimesheetController.php | 9 +- .../Controller/TimesheetController.php | 3 +- src/TimesheetBundle/Entity/Activity.php | 66 +------ src/TimesheetBundle/Entity/Project.php | 173 +----------------- src/TimesheetBundle/EventListener/Menu.php | 15 +- .../Repository/ActivityRepository.php | 77 ++++++++ .../Repository/ProjectRepository.php | 77 ++++++++ .../Repository/TimesheetRepository.php | 8 +- .../Resources/views/admin/activity.html.twig | 36 ++++ .../Resources/views/admin/project.html.twig | 38 ++++ .../Resources/views/admin/timesheet.html.twig | 40 ++++ .../Resources/views/timesheet/index.html.twig | 19 +- 18 files changed, 514 insertions(+), 258 deletions(-) create mode 100644 src/TimesheetBundle/Controller/Admin/ActivityController.php create mode 100644 src/TimesheetBundle/Controller/Admin/ProjectController.php create mode 100644 src/TimesheetBundle/Repository/ActivityRepository.php create mode 100644 src/TimesheetBundle/Repository/ProjectRepository.php create mode 100644 src/TimesheetBundle/Resources/views/admin/activity.html.twig create mode 100644 src/TimesheetBundle/Resources/views/admin/project.html.twig create mode 100644 src/TimesheetBundle/Resources/views/admin/timesheet.html.twig diff --git a/app/Resources/translations/messages.de.xliff b/app/Resources/translations/messages.de.xliff index 1a103c44..3000e936 100644 --- a/app/Resources/translations/messages.de.xliff +++ b/app/Resources/translations/messages.de.xliff @@ -9,10 +9,6 @@ browser.title Kimai - Time Tracking - - app.title - Kimai - + + dashboard.title + Dashboard + + + dashboard.subtitle + Willkommen! + + + + + timesheet.title + Zeiterfassung + + + timesheet.subtitle + Verwalten Sie Ihre Zeiteinträge + + + + + admin_timesheet.title + Mitarbeiter Zeiterfassung + + + admin_timesheet.subtitle + Zeiten aller Benutzer + + + + + admin_project.title + Projekte + + + admin_project.subtitle + Alle vorhandenen Projekte + + + + + admin_activity.title + Aktivitäten + + + admin_activity.subtitle + Aufgaben zur Zeiterfassung + diff --git a/app/Resources/views/bootstrap.html.twig b/app/Resources/views/bootstrap.html.twig index d53a62ee..69223440 100644 --- a/app/Resources/views/bootstrap.html.twig +++ b/app/Resources/views/bootstrap.html.twig @@ -31,7 +31,7 @@
+{% endmacro %} + +{% macro callout(type, description, title) %} +
+ {% if title %}

{{ title|trans }}

{% endif %} +

{{ description|trans }}

+
+{% endmacro %} + {% macro profile_list(user, items, color) %} {% import "AvanzuAdminThemeBundle:layout:macros.html.twig" as macro %}
diff --git a/src/TimesheetBundle/Controller/Admin/ActivityController.php b/src/TimesheetBundle/Controller/Admin/ActivityController.php new file mode 100644 index 00000000..92770ea8 --- /dev/null +++ b/src/TimesheetBundle/Controller/Admin/ActivityController.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace TimesheetBundle\Controller\Admin; + +use TimesheetBundle\Entity\Activity; +use TimesheetBundle\Entity\Timesheet; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; + +/** + * Controller used to manage activities in the admin part of the site. + * + * @Route("/admin/activity") + * @Security("has_role('ROLE_ADMIN')") + * + * @author Kevin Papst + */ +class ActivityController extends Controller +{ + /** + * @Route("/", defaults={"page": 1}, name="admin_activity") + * @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_activity_paginated") + * @Method("GET") + * @Cache(smaxage="10") + */ + public function indexAction($page) + { + /* @var $entries Pagerfanta */ + $entries = $this->getDoctrine()->getRepository(Activity::class)->findAll($page); + + return $this->render('TimesheetBundle:admin:activity.html.twig', ['entries' => $entries]); + } +} diff --git a/src/TimesheetBundle/Controller/Admin/ProjectController.php b/src/TimesheetBundle/Controller/Admin/ProjectController.php new file mode 100644 index 00000000..7be428c2 --- /dev/null +++ b/src/TimesheetBundle/Controller/Admin/ProjectController.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace TimesheetBundle\Controller\Admin; + +use Pagerfanta\Pagerfanta; +use TimesheetBundle\Entity\Project; +use TimesheetBundle\Entity\Timesheet; +use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; + +/** + * Controller used to manage projects in the admin part of the site. + * + * @Route("/admin/project") + * @Security("has_role('ROLE_ADMIN')") + * + * @author Kevin Papst + */ +class ProjectController extends Controller +{ + /** + * @Route("/", defaults={"page": 1}, name="admin_project") + * @Route("/page/{page}", requirements={"page": "[1-9]\d*"}, name="admin_project_paginated") + * @Method("GET") + * @Cache(smaxage="10") + */ + public function indexAction($page) + { + /* @var $entries Pagerfanta */ + $entries = $this->getDoctrine()->getRepository(Project::class)->findAll($page); + + return $this->render('TimesheetBundle:admin:project.html.twig', ['entries' => $entries]); + } +} diff --git a/src/TimesheetBundle/Controller/Admin/TimesheetController.php b/src/TimesheetBundle/Controller/Admin/TimesheetController.php index 30083c17..08a0f474 100644 --- a/src/TimesheetBundle/Controller/Admin/TimesheetController.php +++ b/src/TimesheetBundle/Controller/Admin/TimesheetController.php @@ -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 */ 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]); } } diff --git a/src/TimesheetBundle/Controller/TimesheetController.php b/src/TimesheetBundle/Controller/TimesheetController.php index 2d3e98f6..4efc071f 100644 --- a/src/TimesheetBundle/Controller/TimesheetController.php +++ b/src/TimesheetBundle/Controller/TimesheetController.php @@ -22,7 +22,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; * Controller used to manage timesheet contents in the public part of the site. * * @Route("/timesheet") - * @Security("has_role('ROLE_CUSTOMER')") + * @Security("has_role('ROLE_USER')") * * @author Kevin Papst */ @@ -37,6 +37,7 @@ class TimesheetController extends Controller public function indexAction($page) { $user = $this->getUser(); + /* @var $entries Pagerfanta */ $entries = $this->getDoctrine()->getRepository(Timesheet::class)->findLatest($user, $page); return $this->render('TimesheetBundle:timesheet:index.html.twig', ['entries' => $entries]); diff --git a/src/TimesheetBundle/Entity/Activity.php b/src/TimesheetBundle/Entity/Activity.php index 18ab2af7..79221e47 100644 --- a/src/TimesheetBundle/Entity/Activity.php +++ b/src/TimesheetBundle/Entity/Activity.php @@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM; * Activity * * @ORM\Table(name="activities") - * @ORM\Entity + * @ORM\Entity(repositoryClass="TimesheetBundle\Repository\ActivityRepository") * * @author Kevin Papst */ @@ -54,20 +54,6 @@ class Activity */ private $visible = '1'; - /** - * @var boolean - * - * @ORM\Column(name="filter", type="boolean", nullable=false) - */ - private $filter = '0'; - - /** - * @var boolean - * - * @ORM\Column(name="trash", type="boolean", nullable=false) - */ - private $trash = '0'; - /** * Set name * @@ -140,60 +126,12 @@ class Activity return $this->visible; } - /** - * Set filter - * - * @param boolean $filter - * - * @return Activity - */ - public function setFilter($filter) - { - $this->filter = $filter; - - return $this; - } - - /** - * Get filter - * - * @return boolean - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Set trash - * - * @param boolean $trash - * - * @return Activity - */ - public function setTrash($trash) - { - $this->trash = $trash; - - return $this; - } - - /** - * Get trash - * - * @return boolean - */ - public function getTrash() - { - return $this->trash; - } - /** * Get activityid * * @return integer */ - public function getActivityid() + public function getActivityId() { return $this->activityid; } diff --git a/src/TimesheetBundle/Entity/Project.php b/src/TimesheetBundle/Entity/Project.php index c20f27b8..817ecf13 100644 --- a/src/TimesheetBundle/Entity/Project.php +++ b/src/TimesheetBundle/Entity/Project.php @@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM; * Project * * @ORM\Table(name="projects", indexes={@ORM\Index(name="customerID", columns={"customerID"})}) - * @ORM\Entity + * @ORM\Entity(repositoryClass="TimesheetBundle\Repository\ProjectRepository") * * @author Kevin Papst */ @@ -61,20 +61,6 @@ class Project */ private $visible = '1'; - /** - * @var boolean - * - * @ORM\Column(name="filter", type="boolean", nullable=false) - */ - private $filter = '0'; - - /** - * @var boolean - * - * @ORM\Column(name="trash", type="boolean", nullable=false) - */ - private $trash = '0'; - /** * @var string * @@ -82,35 +68,14 @@ class Project */ private $budget = '0.00'; - /** - * @var string - * - * @ORM\Column(name="effort", type="decimal", precision=10, scale=2, nullable=true) - */ - private $effort; - - /** - * @var string - * - * @ORM\Column(name="approved", type="decimal", precision=10, scale=2, nullable=true) - */ - private $approved; - - /** - * @var boolean - * - * @ORM\Column(name="internal", type="boolean", nullable=false) - */ - private $internal = '0'; - /** * Set customerid * * @param integer $customerid * - * @return KimaiProjects + * @return Project */ - public function setCustomerid($customerid) + public function setCustomerId($customerid) { $this->customerid = $customerid; @@ -122,7 +87,7 @@ class Project * * @return integer */ - public function getCustomerid() + public function getCustomerId() { return $this->customerid; } @@ -132,7 +97,7 @@ class Project * * @param string $name * - * @return KimaiProjects + * @return Project */ public function setName($name) { @@ -156,7 +121,7 @@ class Project * * @param string $comment * - * @return KimaiProjects + * @return Project */ public function setComment($comment) { @@ -180,7 +145,7 @@ class Project * * @param boolean $visible * - * @return KimaiProjects + * @return Project */ public function setVisible($visible) { @@ -199,60 +164,12 @@ class Project return $this->visible; } - /** - * Set filter - * - * @param boolean $filter - * - * @return KimaiProjects - */ - public function setFilter($filter) - { - $this->filter = $filter; - - return $this; - } - - /** - * Get filter - * - * @return boolean - */ - public function getFilter() - { - return $this->filter; - } - - /** - * Set trash - * - * @param boolean $trash - * - * @return KimaiProjects - */ - public function setTrash($trash) - { - $this->trash = $trash; - - return $this; - } - - /** - * Get trash - * - * @return boolean - */ - public function getTrash() - { - return $this->trash; - } - /** * Set budget * * @param string $budget * - * @return KimaiProjects + * @return Project */ public function setBudget($budget) { @@ -271,84 +188,12 @@ class Project return $this->budget; } - /** - * Set effort - * - * @param string $effort - * - * @return KimaiProjects - */ - public function setEffort($effort) - { - $this->effort = $effort; - - return $this; - } - - /** - * Get effort - * - * @return string - */ - public function getEffort() - { - return $this->effort; - } - - /** - * Set approved - * - * @param string $approved - * - * @return KimaiProjects - */ - public function setApproved($approved) - { - $this->approved = $approved; - - return $this; - } - - /** - * Get approved - * - * @return string - */ - public function getApproved() - { - return $this->approved; - } - - /** - * Set internal - * - * @param boolean $internal - * - * @return KimaiProjects - */ - public function setInternal($internal) - { - $this->internal = $internal; - - return $this; - } - - /** - * Get internal - * - * @return boolean - */ - public function getInternal() - { - return $this->internal; - } - /** * Get projectid * * @return integer */ - public function getProjectid() + public function getProjectId() { return $this->projectid; } diff --git a/src/TimesheetBundle/EventListener/Menu.php b/src/TimesheetBundle/EventListener/Menu.php index 699e3785..18794159 100644 --- a/src/TimesheetBundle/EventListener/Menu.php +++ b/src/TimesheetBundle/EventListener/Menu.php @@ -29,16 +29,16 @@ class Menu */ public function onMainMenuConfigure(ConfigureMainMenuEvent $event) { - $menu = $event->getMenu(); $auth = $event->getAuth(); $isLoggedIn = $auth->isGranted('IS_AUTHENTICATED_FULLY'); - $isAdmin = $isLoggedIn && $auth->isGranted('ROLE_ADMIN'); + $isUser = $isLoggedIn && $auth->isGranted('ROLE_USER'); - if (!$isLoggedIn) { + if (!$isLoggedIn || !$isUser) { return; } + $menu = $event->getMenu(); $menu->addItem( new MenuItemModel('timesheet', 'menu.timesheet', 'timesheet', [], 'fa fa-clock-o') ); @@ -60,7 +60,12 @@ class Menu } $menu->addChild( - new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet_index', [], 'fa fa-clock-o') - ); + new MenuItemModel('timesheet_admin', 'menu.admin_timesheet', 'admin_timesheet', [], 'fa fa-clock-o') + )->addChild( + new MenuItemModel('project_admin', 'menu.admin_project', 'admin_project', [], 'fa fa-object-group') + )->addChild( + new MenuItemModel('activity_admin', 'menu.admin_activity', 'admin_activity', [], 'fa fa-tasks') + ) + ; } } \ No newline at end of file diff --git a/src/TimesheetBundle/Repository/ActivityRepository.php b/src/TimesheetBundle/Repository/ActivityRepository.php new file mode 100644 index 00000000..e0ebf464 --- /dev/null +++ b/src/TimesheetBundle/Repository/ActivityRepository.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace TimesheetBundle\Repository; + +use AppBundle\Entity\User; +use TimesheetBundle\Entity\Timesheet; +use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\Query; +use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Pagerfanta; + +/** + * Class ActivityRepository + * + * @author Kevin Papst + */ +class ActivityRepository extends EntityRepository +{ + + /** + * @param User $user + * @return Query + */ + public function queryLatest(User $user = null) + { + $qb = $this->getEntityManager()->createQueryBuilder(); + + $qb->select('a') + ->from('TimesheetBundle:Activity', 'a') + ->orderBy('a.name', 'DESC'); + + return $qb->getQuery(); + } + + /** + * @param User $user + * @param int $page + * @return Pagerfanta + */ + public function findLatest(User $user, $page = 1) + { + return $this->getPager($this->queryLatest($user), $page); + } + + /** + * @param int $page + * + * @return Pagerfanta + */ + public function findAll($page = 1) + { + return $this->getPager($this->queryLatest(), $page); + } + + /** + * @param Query $query + * @param int $page + * @return Pagerfanta + */ + protected function getPager(Query $query, $page = 1) + { + $paginator = new Pagerfanta(new DoctrineORMAdapter($query, false)); + $paginator->setMaxPerPage(25); + $paginator->setCurrentPage($page); + + return $paginator; + } +} diff --git a/src/TimesheetBundle/Repository/ProjectRepository.php b/src/TimesheetBundle/Repository/ProjectRepository.php new file mode 100644 index 00000000..7ef5e220 --- /dev/null +++ b/src/TimesheetBundle/Repository/ProjectRepository.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace TimesheetBundle\Repository; + +use AppBundle\Entity\User; +use TimesheetBundle\Entity\Timesheet; +use Doctrine\ORM\EntityRepository; +use Doctrine\ORM\Query; +use Pagerfanta\Adapter\DoctrineORMAdapter; +use Pagerfanta\Pagerfanta; + +/** + * Class ProjectRepository + * + * @author Kevin Papst + */ +class ProjectRepository extends EntityRepository +{ + + /** + * @param User $user + * @return Query + */ + public function queryLatest(User $user = null) + { + $qb = $this->getEntityManager()->createQueryBuilder(); + + $qb->select('p') + ->from('TimesheetBundle:Project', 'p') + ->orderBy('p.name', 'DESC'); + + return $qb->getQuery(); + } + + /** + * @param User $user + * @param int $page + * @return Pagerfanta + */ + public function findLatest(User $user, $page = 1) + { + return $this->getPager($this->queryLatest($user), $page); + } + + /** + * @param int $page + * + * @return Pagerfanta + */ + public function findAll($page = 1) + { + return $this->getPager($this->queryLatest(), $page); + } + + /** + * @param Query $query + * @param int $page + * @return Pagerfanta + */ + protected function getPager(Query $query, $page = 1) + { + $paginator = new Pagerfanta(new DoctrineORMAdapter($query, false)); + $paginator->setMaxPerPage(25); + $paginator->setCurrentPage($page); + + return $paginator; + } +} diff --git a/src/TimesheetBundle/Repository/TimesheetRepository.php b/src/TimesheetBundle/Repository/TimesheetRepository.php index de405fdf..8d2dc82d 100644 --- a/src/TimesheetBundle/Repository/TimesheetRepository.php +++ b/src/TimesheetBundle/Repository/TimesheetRepository.php @@ -34,12 +34,12 @@ class TimesheetRepository extends EntityRepository { $qb = $this->getEntityManager()->createQueryBuilder(); - $qb->select('p') - ->from('TimesheetBundle:Timesheet', 'p') - ->orderBy('p.start', 'DESC'); + $qb->select('t') + ->from('TimesheetBundle:Timesheet', 't') + ->orderBy('t.start', 'DESC'); if (null !== $user) { - $qb->where('p.user = :user') + $qb->where('t.user = :user') ->setParameter('user', $user); } diff --git a/src/TimesheetBundle/Resources/views/admin/activity.html.twig b/src/TimesheetBundle/Resources/views/admin/activity.html.twig new file mode 100644 index 00000000..3a500ef4 --- /dev/null +++ b/src/TimesheetBundle/Resources/views/admin/activity.html.twig @@ -0,0 +1,36 @@ +{% extends 'base.html.twig' %} +{% import "macros/widgets.html.twig" as widgets %} + +{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %} +{% block page_subtitle %}{{ 'admin_activity.subtitle'|trans }}{% endblock %} + +{% block main %} + {% if entries.count > 0 %} + + + + + + + + + + + {% for entry in entries %} + + + + + + + {% endfor %} + +
{{ 'label.name'|trans }} {{ 'label.comment'|trans }} {{ 'label.visible'|trans }} {{ 'label.id'|trans }}
{{ entry.name }}{{ entry.comment }}{{ entry.visible }}{{ entry.activityId }}
+ + + {% else %} + {{ widgets.callout('warning', 'error.no_entries_found') }} + {% endif %} +{% endblock %} diff --git a/src/TimesheetBundle/Resources/views/admin/project.html.twig b/src/TimesheetBundle/Resources/views/admin/project.html.twig new file mode 100644 index 00000000..e1a5a76a --- /dev/null +++ b/src/TimesheetBundle/Resources/views/admin/project.html.twig @@ -0,0 +1,38 @@ +{% extends 'base.html.twig' %} +{% import "macros/widgets.html.twig" as widgets %} + +{% block page_title %}{{ 'admin_project.title'|trans }}{% endblock %} +{% block page_subtitle %}{{ 'admin_project.subtitle'|trans }}{% endblock %} + +{% block main %} + {% if entries.count > 0 %} + + + + + + + + + + + + {% for entry in entries %} + + + + + + + + {% endfor %} + +
{{ 'label.name'|trans }} {{ 'label.comment'|trans }} {{ 'label.visible'|trans }} {{ 'label.id'|trans }} {{ 'label.budget'|trans }}
{{ entry.name }}{{ entry.comment }}{{ entry.visible }}{{ entry.projectId }}{{ entry.budget}}
+ + + {% else %} + {{ widgets.callout('warning', 'error.no_entries_found') }} + {% endif %} +{% endblock %} diff --git a/src/TimesheetBundle/Resources/views/admin/timesheet.html.twig b/src/TimesheetBundle/Resources/views/admin/timesheet.html.twig new file mode 100644 index 00000000..92134e08 --- /dev/null +++ b/src/TimesheetBundle/Resources/views/admin/timesheet.html.twig @@ -0,0 +1,40 @@ +{% extends 'base.html.twig' %} +{% import "macros/widgets.html.twig" as widgets %} + +{% block page_title %}{{ 'admin_timesheet.title'|trans }}{% endblock %} +{% block page_subtitle %}{{ 'admin_timesheet.subtitle'|trans }}{% endblock %} + +{% block main %} + {% if entries.count > 0 %} + + + + + + + + + + + + + {% for entry in entries %} + + + + + + + + + {% endfor %} + +
{{ 'label.date'|trans }} {{ 'label.starttime'|trans }} {{ 'label.endtime'|trans }} {{ 'label.duration'|trans }} {{ 'label.username'|trans }} {{ 'label.description'|trans }}
{{ entry.start|date(kimai_context.date_1) }}{{ entry.start|date("H:i") }}{{ entry.end|date("H:i") }}{{ entry.duration|gmdate }}{{ entry.user.username }}{{ entry.description }}
+ + + {% else %} + {{ widgets.callout('warning', 'error.no_entries_found') }} + {% endif %} +{% endblock %} diff --git a/src/TimesheetBundle/Resources/views/timesheet/index.html.twig b/src/TimesheetBundle/Resources/views/timesheet/index.html.twig index 7f45b4ff..76b12132 100644 --- a/src/TimesheetBundle/Resources/views/timesheet/index.html.twig +++ b/src/TimesheetBundle/Resources/views/timesheet/index.html.twig @@ -1,10 +1,11 @@ {% extends 'base.html.twig' %} +{% import "macros/widgets.html.twig" as widgets %} -{% block page_title %}Timesheet{% endblock %} -{% block page_subtitle %}manage your times{% endblock %} +{% block page_title %}{{ 'timesheet.title'|trans }}{% endblock %} +{% block page_subtitle %}{{ 'timesheet.subtitle'|trans }}{% endblock %} {% block main %} - {% if entries %} + {% if entries.count > 0 %} @@ -29,11 +30,11 @@ {% endfor %}
- {% else %} -
{{ 'post.no_posts_found'|trans }}
- {% endif %} - + + {% else %} + {{ widgets.callout('warning', 'error.no_entries_found') }} + {% endif %} {% endblock %}