Skip to content
Snippets Groups Projects
Commit 532bec6e authored by Matt Jankowski's avatar Matt Jankowski Committed by Eugen
Browse files

Clean up flash display in views (#2336)

* Add flashes partial to DRY up admin/auth layouts

* Further consolidate flash messages
parent ee82d8a8
No related branches found
No related tags found
Loading
# frozen_string_literal: true
module FlashesHelper
def user_facing_flashes
flash.to_hash.slice('alert', 'error', 'notice', 'success')
end
end
- user_facing_flashes.each do |key, value|
.flash-message{class: key}
%strong= value
......@@ -13,13 +13,7 @@
.content
%h2= yield :page_title
- if flash[:notice]
.flash-message.notice
%strong= flash[:notice]
- if flash[:alert]
.flash-message.alert
%strong= flash[:alert]
= render 'flashes'
= yield
......
......@@ -9,13 +9,7 @@
= image_tag 'logo.png'
.form-container
- if flash[:notice]
.flash-message.notice
%strong= flash[:notice]
- if flash[:alert]
.flash-message.alert
%strong= flash[:alert]
= render 'flashes'
= yield
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment