Browse Source

link page error

develop
Charly 3 years ago
parent
commit
ffb865cad7
4 changed files with 21 additions and 31 deletions
  1. +3
    -0
      Controller/Dashboard/DashboardAdminController.php
  2. +1
    -1
      Controller/ErrorController.php
  3. +0
    -8
      Resources/assets/app/adminlte/main/scss/_common.scss
  4. +17
    -22
      Resources/views/exception/error.html.twig

+ 3
- 0
Controller/Dashboard/DashboardAdminController.php View File



use ControllerTrait; use ControllerTrait;


/**
* @Route("/admin", name="app_admin_dashboard")
*/
public function index(): Response public function index(): Response
{ {
return $this->render('@LcSov/adminlte/dashboard.html.twig'); return $this->render('@LcSov/adminlte/dashboard.html.twig');

+ 1
- 1
Controller/ErrorController.php View File



public function show(Throwable $exception, DebugLoggerInterface $logger = null) public function show(Throwable $exception, DebugLoggerInterface $logger = null)
{ {
if ($this->getRequestStack()->getCurrentRequest()->getPathInfo() == "/admin") {
if (str_contains($this->getRequestStack()->getCurrentRequest(), "/admin")) {
return $this->render('@LcSov/exception/error.html.twig', [ return $this->render('@LcSov/exception/error.html.twig', [
"code" => $exception->getCode(), "code" => $exception->getCode(),
"message" => $exception->getMessage() "message" => $exception->getMessage()

+ 0
- 8
Resources/assets/app/adminlte/main/scss/_common.scss View File

#page-error {
text-align: center;

img {
margin-top: 100px;
}
}

nav.main-header { nav.main-header {
ul.navbar-nav { ul.navbar-nav {
li.nav-item-user-menu { li.nav-item-user-menu {

+ 17
- 22
Resources/views/exception/error.html.twig View File

{% extends '@LcSov/adminlte/layout.html.twig' %}

{% block wrapper %}
{% block navbar_header %}{% endblock %}
{% block sidebar %}{% endblock %}
{% block content %}
<div id="page-error">
<html>
<div id="page-error">
<a href="{{ path('app_admin_dashboard') }}" title="Retourner sur l'admin">Retourner sur l'admin</a>
<div>
<a href="{{ path('app_admin_dashboard') }}" title="Retourner sur l'admin">
<img src="{{ asset('bundles/lcsov/img/erreur-500.png') }}" alt="ERROR"> <img src="{{ asset('bundles/lcsov/img/erreur-500.png') }}" alt="ERROR">
</div>
{% endblock %}
{% endblock %}
{# {% extends 'layout.html' %} #}

{# {% set title = 'Erreur' %} #}
{# {% block page_title %}{% endblock %} #}
{# {% block title %}{{ title }}{% endblock %} #}
</a>
</div>
</div>
<style>
#page-error {
text-align: center;
}


{# {% block content %} #}
{# {% embed 'bundles/TwigBundle/Exception/_content.html.twig' %} #}
{# {% block content_error %} #}
{# <p>Une erreur est survenue.TEST</p> #}
{# {% endblock %} #}
{# {% endembed %} #}
{# {% endblock %} #}
img {
margin-top: 100px;
}
</style>
</html>

Loading…
Cancel
Save