diff --git a/README.md b/README.md index 392b9936..839c3f86 100644 --- a/README.md +++ b/README.md @@ -90,12 +90,13 @@ APP_ENV=dev APP_SECRET=some_random_secret_string_for_your_installation ``` -Now create the database schemas: +Now create the database schemas and warm up the cache: ```bash $ bin/console doctrine:schema:create +$ bin/console cache:warmup --env=prod ``` -And finally create your first user: +Finally create your first user: ```bash $ bin/console kimai:create-user username password admin@example.com ROLE_SUPER_ADMIN diff --git a/composer.lock b/composer.lock index b23ad57f..5af931d8 100644 --- a/composer.lock +++ b/composer.lock @@ -2508,24 +2508,24 @@ }, { "name": "symfony/flex", - "version": "v1.0.61", + "version": "v1.0.66", "source": { "type": "git", "url": "https://github.com/symfony/flex.git", - "reference": "f872f8faccf5ff95678e1e428f460a333ba1e5d0" + "reference": "b366e902710c8dc8d8be97ed8d64ef574d9bffcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/flex/zipball/f872f8faccf5ff95678e1e428f460a333ba1e5d0", - "reference": "f872f8faccf5ff95678e1e428f460a333ba1e5d0", + "url": "https://api.github.com/repos/symfony/flex/zipball/b366e902710c8dc8d8be97ed8d64ef574d9bffcb", + "reference": "b366e902710c8dc8d8be97ed8d64ef574d9bffcb", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1", + "composer-plugin-api": "^1.0", "php": "^7.0" }, "require-dev": { - "composer/composer": "^1.4", + "composer/composer": "^1.0.2", "symfony/phpunit-bridge": "^3.2.8" }, "type": "composer-plugin", @@ -2550,7 +2550,7 @@ "email": "fabien.potencier@gmail.com" } ], - "time": "2018-01-12T13:09:44+00:00" + "time": "2018-01-21T09:15:48+00:00" }, { "name": "symfony/form", @@ -3984,21 +3984,21 @@ }, { "name": "symfony/thanks", - "version": "v1.0.1", + "version": "v1.0.3", "source": { "type": "git", "url": "https://github.com/symfony/thanks.git", - "reference": "b637913a92664571afd1067fc645ecb30c9cf5b2" + "reference": "8c12bbe4baabcb8e640efaaaab40e3a4497c9fb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/thanks/zipball/b637913a92664571afd1067fc645ecb30c9cf5b2", - "reference": "b637913a92664571afd1067fc645ecb30c9cf5b2", + "url": "https://api.github.com/repos/symfony/thanks/zipball/8c12bbe4baabcb8e640efaaaab40e3a4497c9fb4", + "reference": "8c12bbe4baabcb8e640efaaaab40e3a4497c9fb4", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1", - "php": "^5.5.9|^7.0.8" + "composer-plugin-api": "^1.0", + "php": "^5.5.9|^7.0.0" }, "type": "composer-plugin", "extra": { @@ -4023,7 +4023,7 @@ } ], "description": "Give thanks (in the form of a GitHub ⭐) to your fellow PHP package maintainers (not limited to Symfony components)!", - "time": "2018-01-03T09:30:52+00:00" + "time": "2018-01-19T16:12:41+00:00" }, { "name": "symfony/translation", diff --git a/config/routes/dev/twig.yaml b/config/routes/dev/twig.yaml index 56fecc76..a85c61e5 100644 --- a/config/routes/dev/twig.yaml +++ b/config/routes/dev/twig.yaml @@ -1,6 +1,6 @@ _errors: resource: '@TwigBundle/Resources/config/routing/errors.xml' - prefix: /_error + prefix: /{_locale}/_error requirements: _locale: '%app_locales%' defaults: diff --git a/src/Controller/Admin/CustomerController.php b/src/Controller/Admin/CustomerController.php index 6e1fdb19..4785d021 100644 --- a/src/Controller/Admin/CustomerController.php +++ b/src/Controller/Admin/CustomerController.php @@ -161,7 +161,7 @@ class CustomerController extends AbstractController protected function getToolbarForm(CustomerQuery $query) { return $this->createForm(CustomerToolbarForm::class, $query, [ - 'action' => $this->generateUrl('admin_customer_paginated', [ + 'action' => $this->generateUrl('admin_customer', [ 'page' => $query->getPage(), ]), 'method' => 'GET', diff --git a/src/Controller/Admin/ProjectController.php b/src/Controller/Admin/ProjectController.php index 295806e4..69dd4777 100644 --- a/src/Controller/Admin/ProjectController.php +++ b/src/Controller/Admin/ProjectController.php @@ -165,7 +165,7 @@ class ProjectController extends AbstractController protected function getToolbarForm(ProjectQuery $query) { return $this->createForm(ProjectToolbarForm::class, $query, [ - 'action' => $this->generateUrl('admin_project_paginated', [ + 'action' => $this->generateUrl('admin_project', [ 'page' => $query->getPage(), ]), 'method' => 'GET', diff --git a/src/Controller/Admin/UserController.php b/src/Controller/Admin/UserController.php index 59346857..04290eda 100644 --- a/src/Controller/Admin/UserController.php +++ b/src/Controller/Admin/UserController.php @@ -104,7 +104,7 @@ class UserController extends AbstractController protected function getToolbarForm(UserQuery $query) { return $this->createForm(UserToolbarForm::class, $query, [ - 'action' => $this->generateUrl('admin_user_paginated', [ + 'action' => $this->generateUrl('admin_user', [ 'page' => $query->getPage(), ]), 'method' => 'GET', diff --git a/src/EventSubscriber/NavbarShowUserSubscriber.php b/src/EventSubscriber/NavbarShowUserSubscriber.php index 29d7ab1f..a7078792 100644 --- a/src/EventSubscriber/NavbarShowUserSubscriber.php +++ b/src/EventSubscriber/NavbarShowUserSubscriber.php @@ -54,6 +54,10 @@ class NavbarShowUserSubscriber implements EventSubscriberInterface */ public function onShowUser(ShowUserEvent $event) { + if ($this->storage->getToken() === null) { + return; + } + /* @var $myUser User */ $myUser = $this->storage->getToken()->getUser(); diff --git a/templates/bundles/TwigBundle/Exception/error.html.twig b/templates/bundles/TwigBundle/Exception/error.html.twig index 05c97565..d7bfe7b3 100644 --- a/templates/bundles/TwigBundle/Exception/error.html.twig +++ b/templates/bundles/TwigBundle/Exception/error.html.twig @@ -7,22 +7,33 @@ your application from some errors. See http://symfony.com/doc/current/cookbook/controller/error_pages.html #} + + +
+ +- {{ 'http_error.description'|trans({ '%status_code%': status_code }) }} -
-- {{ 'http_error.suggestion'|trans({ '%url%': path('homepage') })|raw }} -
-{% endblock %} - -{% block sidebar %} - {{ parent() }} -{% endblock %} +- {{ 'http_error_403.description'|trans }} -
-- {{ 'http_error_403.suggestion'|trans }} -
+ {% set errorMessageKey = "http_error_#{status_code}.suggestion" %} + {% set errorMessageTrans = errorMessageKey|trans({ '%status_code%': status_code }, 'exceptions') %} + {% if errorMessageKey == errorMessageTrans %} + {% set errorMessageKey = 'http_error.suggestion' %} + {% set errorMessageTrans = errorMessageKey|trans({ '%status_code%': status_code }, 'exceptions') %} + {% endif %} + +{{ errorMessageTrans }}
+- {{ 'http_error_404.description'|trans }} -
-- {{ 'http_error_404.suggestion'|trans({ '%url%': path('homepage') })|raw }} -
+ {% set errorMessageKey = "http_error_#{status_code}.suggestion" %} + {% set errorMessageTrans = errorMessageKey|trans({ '%status_code%': status_code }, 'exceptions') %} + {% if errorMessageKey == errorMessageTrans %} + {% set errorMessageKey = 'http_error.suggestion' %} + {% set errorMessageTrans = errorMessageKey|trans({ '%status_code%': status_code }, 'exceptions') %} + {% endif %} + +{{ errorMessageTrans }}
+- {{ 'http_error_500.description'|trans }} -
-- {{ 'http_error_500.suggestion'|trans({ '%url%': path('homepage') })|raw }} -
-{% endblock %} - -{% block sidebar %} - {{ parent() }} -{% endblock %} +{% extends '@Twig/Exception/error.html.twig' %} diff --git a/translations/exceptions.de.xliff b/translations/exceptions.de.xliff index 300fe726..219a4512 100644 --- a/translations/exceptions.de.xliff +++ b/translations/exceptions.de.xliff @@ -6,6 +6,48 @@