Templating: Improved error templates

This commit is contained in:
Igor Scheller 2018-11-13 17:47:19 +01:00 committed by msquare
parent c33940f64a
commit 2588bbf7bc
5 changed files with 75 additions and 4 deletions

View File

@ -1,4 +1,5 @@
@import "../../../node_modules/bootstrap/less/bootstrap"; @import "../../../node_modules/bootstrap/less/bootstrap";
@import "error";
body { body {
padding-top: 50px; padding-top: 50px;
@ -17,7 +18,7 @@ body {
display: block; display: block;
font-size: 30px; font-size: 30px;
line-height: 30px; line-height: 30px;
margin: 0px; margin: 0;
} }
.icon-icon_angel { .icon-icon_angel {
@ -135,7 +136,7 @@ table a > .icon-icon_angel {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: nowrap; flex-wrap: nowrap;
align-itmes: stretch; align-items: stretch;
width: 100%; width: 100%;
.lane { .lane {

View File

@ -0,0 +1,33 @@
/* =============================================================
Error page
============================================================= */
.error-big {
text-align: center;
h2 {
font-size: 10em;
font-weight: bold;
small {
display: block;
font-size: 0.3em;
}
@keyframes error-page-pulse {
from {
opacity: 0.3;
}
to {
opacity: 1.0;
}
}
.pulse {
animation-name: error-page-pulse;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
animation-direction: alternate;
}
}
}

View File

@ -0,0 +1,5 @@
{% extends "errors/default.twig" %}
{% block title %}{{ __("Forbidden") }}{% endblock %}
{% block content_headline_text %}{{ __("You are not allowed to access this page") }}{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends "errors/default.twig" %}
{% block title %}{{ __("Page not found") }}{% endblock %}
{% block content_container %}
<div class="row">
<div class="col-sm-6 col-sm-offset-3 error-big">
<h2>
4<span class="pulse">:</span>{{ status|slice(1, 2) }}
<small>{{ __("No sleep found") }}</small>
</h2>
{% block content_text %}
{{ content }}
{% endblock %}
</div>
</div>
{% endblock %}

View File

@ -1,7 +1,21 @@
{% extends "layouts/app.twig" %} {% extends "layouts/app.twig" %}
{% block title %}{% if status == 404 %}{{ __("Page not found") }}{% else %}Error {{ status }}{% endif %}{% endblock %} {% block title %}Error {{ status }}{% endblock %}
{% block content %} {% block content %}
<div class="alert alert-info">{{ content }}</div> <div class="container">
{% block content_container %}
<div class="alert alert-info">
{% block content_headline %}
<h2>{% block content_headline_text %}Error {{ status }}{% endblock %}</h2>
{% endblock %}
{% block content_text %}
{{ content }}
{% endblock %}
</div>
{% endblock %}
</div>
{% endblock %} {% endblock %}