X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/ec56eaf0f2b04d4974d1f464697f7fd71f5084b4..b34de25b1136a5784f954c36f5d76e7017fbc48a:/app/views/layouts/_flash.html.erb?ds=sidebyside diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index 0f39c4a47..8a7ed6fe4 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -1,29 +1,13 @@ -<% if flash[:error] %> - <div class="flash error"> - <picture> - <source srcset="<%= image_path "notice.svg" %>" type="image/svg+xml" /> - <%= image_tag("notice.png", :srcset => image_path("notice.svg"), :class => "small_icon", :border => 0) %> - </picture> - <div class="message"><%= flash[:error] %></div> - </div> -<% end %> - -<% if flash[:warning] %> - <div class="flash warning"> - <picture> - <source srcset="<%= image_path "notice.svg" %>" type="image/svg+xml"></source> - <%= image_tag("notice.png", :srcset => image_path("notice.svg"), :class => "small_icon", :border => 0) %> - </picture> - <div class="message"><%= flash[:warning] %></div> - </div> -<% end %> - -<% if flash[:notice] %> - <div class="flash notice"> - <picture> - <source srcset="<%= image_path "notice.svg" %>" type="image/svg+xml"></source> - <%= image_tag("notice.png", :srcset => image_path("notice.svg"), :class => "small_icon", :border => 0) %> - </picture> - <div class="message"><%= flash[:notice] %></div> - </div> +<% [[:error, :danger], [:warning, :warning], [:notice, :success]].each do |flash_type, bootstrap_type| %> + <% if flash[flash_type] %> + <%= tag.div :class => "alert alert-#{bootstrap_type} row mx-0 mb-0 p-3 rounded-0 align-items-center", + :data => { :turbo_temporary => true } do %> + <div class="col-auto"> + <%= notice_svg_tag %> + </div> + <div class="col"> + <%= render_flash flash[flash_type] %> + </div> + <% end %> + <% end %> <% end %>