mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 14:07:25 +01:00
Optimized flash messages
This commit is contained in:
parent
412c677c65
commit
56fb409477
@ -21,7 +21,7 @@ class SecurityController extends AbstractController
|
|||||||
{
|
{
|
||||||
$error = $authenticationUtils->getLastAuthenticationError();
|
$error = $authenticationUtils->getLastAuthenticationError();
|
||||||
if ($error) {
|
if ($error) {
|
||||||
$this->addFlash('notice', $error);
|
$this->addFlash('danger', $error->getMessage());
|
||||||
}
|
}
|
||||||
return $this->render("user/login.html.twig",[
|
return $this->render("user/login.html.twig",[
|
||||||
'last_username'=>$authenticationUtils->getLastUsername(),
|
'last_username'=>$authenticationUtils->getLastUsername(),
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{% extends "base.html.twig" %}
|
{% extends "base.html.twig" %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
{% include 'frames/structure/navbar.html.twig'%}
|
{% include 'frames/structure/navbar.html.twig'%}
|
||||||
{% include 'frames/structure/message/flash_messages.html.twig'%}
|
|
||||||
<br />
|
<br />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
{% include 'frames/structure/message/flash_messages.html.twig'%}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
{% for message in app.flashes('notice') %}
|
{% set icons = {'success':'fas fa-check-circle','danger':'fas fa-times','warning':'fas fa-exclamation-triangle','info':'fas fa-info'} %}
|
||||||
<div class="flash-notice">
|
{% for label,messages in app.flashes %}
|
||||||
{{ message }}
|
{% for message in messages %}
|
||||||
</div>
|
<div class="alert alert-{{ label }}">
|
||||||
|
<i class="{{ icons[label] }}"></i> {{ message }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
Loading…
Reference in New Issue
Block a user