Skip to content
Snippets Groups Projects
Commit ce3f9080 authored by Camille Simiand's avatar Camille Simiand
Browse files

Uniformize flashMessages refacto

parent 73c5df97
No related branches found
No related tags found
1 merge request!77tuleap-162-close-the-feedback-message-or-not-having-a-timeout-display
Pipeline #946 passed
...@@ -100,7 +100,7 @@ class RegistrationController extends AbstractController ...@@ -100,7 +100,7 @@ class RegistrationController extends AbstractController
$this->addCapsuleToConfirmedPreviousPendingEditor($user); $this->addCapsuleToConfirmedPreviousPendingEditor($user);
$this->addFlash( $this->addFlash(
'email_verified_success', 'success',
$translator->trans('registration.email_verified_success') $translator->trans('registration.email_verified_success')
); );
......
...@@ -86,7 +86,7 @@ class ResetPasswordController extends AbstractController ...@@ -86,7 +86,7 @@ class ResetPasswordController extends AbstractController
throw new \Exception("User should be an instance of UserPasswordHasherInterface"); throw new \Exception("User should be an instance of UserPasswordHasherInterface");
} }
} catch (ResetPasswordExceptionInterface $e) { } catch (ResetPasswordExceptionInterface $e) {
$this->addFlash('reset_password_error', sprintf( $this->addFlash('error', sprintf(
'There was a problem validating your reset request - %s', 'There was a problem validating your reset request - %s',
$e->getReason() $e->getReason()
)); ));
......
...@@ -133,7 +133,7 @@ class UserController extends AbstractController ...@@ -133,7 +133,7 @@ class UserController extends AbstractController
$this->entity_manager->flush(); $this->entity_manager->flush();
$this->addFlash( $this->addFlash(
'profile_updated_success', 'success',
$this->translator->trans('user.password.updated_success') $this->translator->trans('user.password.updated_success')
); );
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
</div> </div>
{% for flashWarning in app.flashes('warning') %} {% for flashWarning in app.flashes('warning') %}
<div class="text-center alert alert-warning col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashWarning }} {{ flashWarning }}
</div> </div>
{% endfor %} {% endfor %}
{% for flashSuccess in app.flashes('success') %} {% for flashSuccess in app.flashes('success') %}
<div class="text-center alert alert-success col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-success col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashSuccess }} {{ flashSuccess }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
</div> </div>
{% for flashWarning in app.flashes('warning') %} {% for flashWarning in app.flashes('warning') %}
<div class="text-center alert alert-warning col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashWarning }} {{ flashWarning }}
</div> </div>
{% endfor %} {% endfor %}
{% for flashSuccess in app.flashes('success') %} {% for flashSuccess in app.flashes('success') %}
<div class="text-center alert alert-success col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-success col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashSuccess }} {{ flashSuccess }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -17,13 +17,13 @@ ...@@ -17,13 +17,13 @@
</div> </div>
{% for flashWarning in app.flashes('warning') %} {% for flashWarning in app.flashes('warning') %}
<div class="text-center alert alert-warning col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashWarning }} {{ flashWarning }}
</div> </div>
{% endfor %} {% endfor %}
{% for flashSuccess in app.flashes('success') %} {% for flashSuccess in app.flashes('success') %}
<div class="text-center alert alert-success col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 mt-2" role="alert"> <div class="text-center alert alert-success col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashSuccess }} {{ flashSuccess }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
</div> </div>
{% for flashWarning in app.flashes('warning') %} {% for flashWarning in app.flashes('warning') %}
<div class="text-center alert alert-warning col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5" role="alert"> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashWarning }} {{ flashWarning }}
</div> </div>
{% endfor %} {% endfor %}
{% for flashSuccess in app.flashes('success') %} {% for flashSuccess in app.flashes('success') %}
<div class="text-center alert alert-success col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5" role="alert"> <div class="text-center alert alert-success col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashSuccess }} {{ flashSuccess }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
{% block body %} {% block body %}
<div class="mt-4"> <div class="mt-4">
{% for flashError in app.flashes('error') %} {% for flashError in app.flashes('error') %}
<div class="alert alert-danger col-11 col-md-10 col-lg-9 col-xl-8 mx-auto my-5 h1" role="alert"> <div class="alert alert-danger col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5 h1" role="alert">
{{ flashError }} {{ flashError }}
</div> </div>
{% endfor %} {% endfor %}
......
...@@ -5,8 +5,10 @@ ...@@ -5,8 +5,10 @@
{% endblock %} {% endblock %}
{% block body %} {% block body %}
{% for flashError in app.flashes('reset_password_error') %} {% for flashError in app.flashes('error') %}
<div class="alert alert-danger" role="alert">{{ flashError }}</div> <div class="text-center alert alert-danger col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashError }}
</div>
{% endfor %} {% endfor %}
<h1 class="m-auto mb-4 mt-4 col-6"> <h1 class="m-auto mb-4 mt-4 col-6">
{{ 'reset_password.title'|trans }} {{ 'reset_password.title'|trans }}
......
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
{% if error %} {% if error %}
<div class="alert alert-danger col-6 m-auto">{{ error.messageKey|trans(error.messageData, 'security') }}</div> <div class="alert alert-danger col-6 m-auto">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %} {% endif %}
{% for flashMessage in app.flashes('email_verified_success') %} {% for flashMessage in app.flashes('error') %}
<div class="text-center alert alert-warning col-6 m-auto" role="alert" >{{ flashMessage }}</div> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert" >
{{ flashMessage }}
</div>
{% endfor %} {% endfor %}
<form method="post" class="d-flex flex-column justify-content-center"> <form method="post" class="d-flex flex-column justify-content-center">
......
...@@ -14,13 +14,13 @@ ...@@ -14,13 +14,13 @@
</div> </div>
{% for flashSuccess in app.flashes('success') %} {% for flashSuccess in app.flashes('success') %}
<div class="text-center alert alert-success col-11 col-md-10 col-lg-9 col-xl-8 mx-auto mt-0 mb-4" role="alert"> <div class="text-center alert alert-success col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashSuccess }} {{ flashSuccess }}
</div> </div>
{% endfor %} {% endfor %}
{% for flashWarning in app.flashes('warning') %} {% for flashWarning in app.flashes('warning') %}
<div class="text-center alert alert-warning col-11 col-md-10 col-lg-9 col-xl-8 mx-auto mt-0 mb-4" role="alert"> <div class="text-center alert alert-warning col-11 col-md-10 col-lg-8 col-xl-6 mx-auto mb-5" role="alert">
{{ flashWarning }} {{ flashWarning }}
</div> </div>
{% endfor %} {% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment