mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Fix flash messages on sign-in [SCI-5386]
This commit is contained in:
parent
5f506b7459
commit
cf3b0916f6
2 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,10 @@ module ApplicationHelper
|
||||||
controller_name == 'my_modules' && !@repository.nil?
|
controller_name == 'my_modules' && !@repository.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def displayable_flash_type?(type)
|
||||||
|
%w(success warning error notice).include?(type)
|
||||||
|
end
|
||||||
|
|
||||||
def flash_alert_class(type)
|
def flash_alert_class(type)
|
||||||
case type
|
case type
|
||||||
when 'success'
|
when 'success'
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
<div id="notifications">
|
<div id="notifications">
|
||||||
<% flash.each do |type, message| %>
|
<% flash.each do |type, message| %>
|
||||||
|
<% next unless displayable_flash_type?(type) %>
|
||||||
|
|
||||||
<div id="alert-flash" class="alert <%= flash_alert_class(type) %> alert-dismissable alert-floating">
|
<div id="alert-flash" class="alert <%= flash_alert_class(type) %> alert-dismissable alert-floating">
|
||||||
<span class="fas <%= flash_icon_class(type) %>"></span>
|
<span class="fas <%= flash_icon_class(type) %>"></span>
|
||||||
<span class="message"><%= sanitize_input(message) %></span>
|
<span class="message"><%= sanitize_input(message) %></span>
|
||||||
|
|
Loading…
Add table
Reference in a new issue