forked from wallabag/wallabag
Customize errors templates
All error goes to the same template which only display the error message and the status code.
This commit is contained in:
@ -133,3 +133,9 @@ services:
|
||||
host: '%redis_host%'
|
||||
port: '%redis_port%'
|
||||
schema: tcp
|
||||
|
||||
wallabag_core.exception_controller:
|
||||
class: Wallabag\CoreBundle\Controller\ExceptionController
|
||||
arguments:
|
||||
- '@twig'
|
||||
- '%kernel.debug%'
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
{% extends "WallabagCoreBundle::layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'error.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block body_class %}login{% endblock %}
|
||||
|
||||
{% block menu %}{% endblock %}
|
||||
{% block messages %}{% endblock %}
|
||||
{% block header %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main class="valign-wrapper">
|
||||
<div class="valign row">
|
||||
<div class="card sw">
|
||||
<div class="center"><img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-w.png') }}" alt="wallabag logo" /></div>
|
||||
<h2>{{ status_code }}: {{ status_text }}</h2>
|
||||
<p>{{ exception.message }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
@ -0,0 +1,30 @@
|
||||
{% extends "WallabagCoreBundle::layout.html.twig" %}
|
||||
|
||||
{% block title %}{{ 'error.page_title'|trans }}{% endblock %}
|
||||
|
||||
{% block body_class %}login{% endblock %}
|
||||
|
||||
{% block menu %}{% endblock %}
|
||||
{% block messages %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<main class="valign-wrapper">
|
||||
<div class="valign row">
|
||||
<div class="card sw">
|
||||
<div class="center"><img src="{{ asset('bundles/wallabagcore/themes/_global/img/logo-other_themes.png') }}" alt="wallabag logo" /></div>
|
||||
<div class="card-content">
|
||||
<div class="row">
|
||||
<h5>{{ status_code }}: {{ status_text }}</h5>
|
||||
<p>{{ exception.message }}</p>
|
||||
{# {% for trace in exception.trace %}
|
||||
<p>{{ trace.class }} - {{ trace.type }} - {{ trace.file }} - {{ trace.line }}</p>
|
||||
{% endfor %} #}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user