|
|
@ -1,10 +1,27 @@ |
|
|
|
<h2>NOTIFICATION BAR</h2> |
|
|
|
|
|
|
|
<% if flash %> |
|
|
|
<% if flash.count.positive? %> |
|
|
|
<script type="module"> |
|
|
|
import { Notyf } from 'notyf'; |
|
|
|
const notyf=new Notyf |
|
|
|
notyf.success('<%=notice%>') |
|
|
|
notyf.error('<%=alert%>') |
|
|
|
import Toastify from 'toastify-js' |
|
|
|
|
|
|
|
const notyf=new Notyf({ |
|
|
|
duration: 3000, |
|
|
|
position: { |
|
|
|
x: 'center', |
|
|
|
y: 'top', |
|
|
|
} |
|
|
|
}) |
|
|
|
<% if flash.alert %> |
|
|
|
notyf.error('<%=alert%>') |
|
|
|
Toastify({ text: "<%=alert%>", gravity: "top", oldestFirst: false, close: true, position: "center", style: { background: "red" }}).showToast(); |
|
|
|
<%end%> |
|
|
|
|
|
|
|
<% if flash.notice %> |
|
|
|
notyf.success('<%=notice%>') |
|
|
|
Toastify({ text: "<%=notice%>", gravity: "top", oldestFirst: false, close: true, position: "center", style: { background: "green" }}).showToast(); |
|
|
|
<%end%> |
|
|
|
|
|
|
|
console.log('notification loaded') |
|
|
|
</script> |
|
|
|
<%end%> |