27 lines
697 B
Text
27 lines
697 B
Text
// Display alert messages to the user
|
|
|
|
- if flash
|
|
- flash.each do |name,msg|
|
|
- case name
|
|
- when 'notice'
|
|
- flash_color = 'white'
|
|
- flash_bgcolor = 'green'
|
|
- when 'alert'
|
|
- flash_color = 'white'
|
|
- flash_bgcolor = 'red'
|
|
- else
|
|
- flash_color = 'black'
|
|
- flash_bgcolor = 'gray'
|
|
|
|
javascript:
|
|
$.amaran({
|
|
'content': {
|
|
'message' :'#{name}: #{msg}',
|
|
'color' : '#{flash_color}',
|
|
'bgcolor' : '#{flash_bgcolor}'
|
|
},
|
|
'position' :'top right',
|
|
'theme' : 'colorful',
|
|
'cssanimationIn' :'bounceInDown',
|
|
'cssanimationOut' :'zoomOutUp'
|
|
});
|