Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F401877
flash_helper.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 20, 1:42 PM
Size
729 B
Mime Type
text/x-ruby
Expires
Sat, Feb 22, 1:42 PM (19 h, 9 m)
Engine
blob
Format
Raw Data
Handle
191855
Attached To
rARCHIVING archiving
flash_helper.rb
View Options
module
FlashHelper
def
bootstrap_class_for
(
flash_type
)
{
success
:
'alert-success'
,
error
:
'alert-danger'
,
alert
:
'alert-warning'
,
notice
:
'alert-info'
}
.
fetch
(
flash_type
.
to_sym
,
flash_type
.
to_s
)
end
def
flash_messages
flash
.
each
do
|
msg_type
,
message
|
concat
(
content_tag
(
:div
,
message
,
class
:
"alert
#{
bootstrap_class_for
(
msg_type
)
}
fade in"
)
do
concat
content_tag
(
:button
,
'x'
,
class
:
'close'
,
data
:
{
dismiss
:
'alert'
})
concat
message
end
)
end
nil
end
def
notifier
(
msg
)
content_tag
(
:div
,
class
:
"alert
#{
bootstrap_class_for
(
msg
[
:severity
]
)
}
fade in"
)
do
content_tag
(
:p
,
msg
[
:message
]
)
end
end
end
Event Timeline
Log In to Comment