From 1f9e7b36de28e693d4902f2c7498f3f25a44aac2 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Wed, 18 Jun 2025 17:17:15 +0300 Subject: [PATCH] Make flash alerts dismissable --- app/views/layouts/_flash.html.erb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/app/views/layouts/_flash.html.erb b/app/views/layouts/_flash.html.erb index 8a7ed6fe4..3fb794856 100644 --- a/app/views/layouts/_flash.html.erb +++ b/app/views/layouts/_flash.html.erb @@ -1,13 +1,16 @@ <% [[: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", + <%= tag.div :class => "alert alert-dismissible alert-#{bootstrap_type} mb-0 rounded-0", :data => { :turbo_temporary => true } do %> -
- <%= notice_svg_tag %> -
-
- <%= render_flash flash[flash_type] %> +
+
+ <%= notice_svg_tag %> +
+
+ <%= render_flash flash[flash_type] %> +
+ <% end %> <% end %> <% end %> -- 2.39.5