From 278522cfc37b65bf240b805407022d5121b8d38d Mon Sep 17 00:00:00 2001 From: Maciej Szlosarczyk Date: Tue, 26 Jun 2018 15:52:46 +0300 Subject: [PATCH] Revert to old flash behavior --- .../application/_flash_messages.html.erb | 30 +++++-------------- .../layouts/registrant/application.html.erb | 2 +- app/views/layouts/registrar/base.html.erb | 2 +- app/views/layouts/registrar/sessions.html.erb | 2 +- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/app/views/application/_flash_messages.html.erb b/app/views/application/_flash_messages.html.erb index 9b31f0d3f..364e3e5ca 100644 --- a/app/views/application/_flash_messages.html.erb +++ b/app/views/application/_flash_messages.html.erb @@ -1,24 +1,8 @@ -<% if flash[:notice] %> -
- - <% if flash[:notice].respond_to?(:join) %> -

<%= flash[:notice].join('
').html_safe %>

- <% else %> -

<%= flash[:notice] %>

- <% end %> +<% display = (flash[:notice] || flash[:alert] || flash[:warning]) ? 'block' : 'none' %> +
+ <% type = (flash[:notice]) ? 'bg-success' : 'bg-danger' %> + <% type = 'bg-warning' if flash[:warning] %> +
+ <%= flash[:notice] || flash[:alert] || flash[:warning] %>
-<% end %> - -<% if flash[:alert] %> -
- -

<%= flash[:alert] %>

-
-<% end %> - -<% if flash[:info] %> -
- -

<%= flash[:info] %>

-
-<% end %> +
diff --git a/app/views/layouts/registrant/application.html.erb b/app/views/layouts/registrant/application.html.erb index 075ac4652..b5ddb5f0f 100644 --- a/app/views/layouts/registrant/application.html.erb +++ b/app/views/layouts/registrant/application.html.erb @@ -65,7 +65,7 @@
- <%= render 'shared/flash' %> + <%= render 'flash_messages' %> <%= yield %>