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

Uniformize flashMessages refacto

parent 73c5df97
Branches
Tags
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
$this->addCapsuleToConfirmedPreviousPendingEditor($user);
$this->addFlash(
'email_verified_success',
'success',
$translator->trans('registration.email_verified_success')
);
......
......@@ -86,7 +86,7 @@ class ResetPasswordController extends AbstractController
throw new \Exception("User should be an instance of UserPasswordHasherInterface");
}
} catch (ResetPasswordExceptionInterface $e) {
$this->addFlash('reset_password_error', sprintf(
$this->addFlash('error', sprintf(
'There was a problem validating your reset request - %s',
$e->getReason()
));
......
......@@ -133,7 +133,7 @@ class UserController extends AbstractController
$this->entity_manager->flush();
$this->addFlash(
'profile_updated_success',
'success',
$this->translator->trans('user.password.updated_success')
);
......
......@@ -18,13 +18,13 @@
</div>
{% 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 }}
</div>
{% endfor %}
{% 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 }}
</div>
{% endfor %}
......
......@@ -18,13 +18,13 @@
</div>
{% 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 }}
</div>
{% endfor %}
{% 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 }}
</div>
{% endfor %}
......
......@@ -17,13 +17,13 @@
</div>
{% 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 }}
</div>
{% endfor %}
{% 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 }}
</div>
{% endfor %}
......
......@@ -34,13 +34,13 @@
</div>
{% 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 }}
</div>
{% endfor %}
{% 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 }}
</div>
{% endfor %}
......
......@@ -7,7 +7,7 @@
{% block body %}
<div class="mt-4">
{% 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 }}
</div>
{% endfor %}
......
......@@ -5,8 +5,10 @@
{% endblock %}
{% block body %}
{% for flashError in app.flashes('reset_password_error') %}
<div class="alert alert-danger" role="alert">{{ flashError }}</div>
{% for flashError in app.flashes('error') %}
<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 %}
<h1 class="m-auto mb-4 mt-4 col-6">
{{ 'reset_password.title'|trans }}
......
......@@ -8,8 +8,10 @@
{% if error %}
<div class="alert alert-danger col-6 m-auto">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
{% for flashMessage in app.flashes('email_verified_success') %}
<div class="text-center alert alert-warning col-6 m-auto" role="alert" >{{ flashMessage }}</div>
{% for flashMessage in app.flashes('error') %}
<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 %}
<form method="post" class="d-flex flex-column justify-content-center">
......
......@@ -14,13 +14,13 @@
</div>
{% 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 }}
</div>
{% endfor %}
{% 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 }}
</div>
{% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment