8 changed files with 51 additions and 90 deletions
-
35app/assets/stylesheets/toastify.css
-
4app/assets/tailwind/application.css
-
2app/javascript/controllers/flash_controller.js
-
3app/views/layouts/application.html.erb
-
46app/views/layouts/components/_flash.html.erb
-
12app/views/layouts/components/_flashbar.html.erb
-
26app/views/layouts/components/_footer.html.erb
-
13app/views/notification/index.html.erb
@ -1,46 +0,0 @@ |
|||
<div |
|||
id='flash-container' |
|||
style='max-width: calc(50% - 20px)' |
|||
data-controller='flash' |
|||
data-action="popup-toast@window->flash#popup" |
|||
> |
|||
<!-- |
|||
here is a shadow root which serves as a placeholder for the toaster area. |
|||
max-width gets inherited from this node. |
|||
--> |
|||
</div> |
|||
|
|||
<footer class="footer sm:footer-horizontal footer-center bg-base-300 text-base-content p-4"> |
|||
<aside> |
|||
<%= Rails.application.name.upcase %> app is free software<br/> |
|||
Copyleft: AGPLv3<br/> |
|||
source code<br/> |
|||
</aside> |
|||
|
|||
<aside data-controller='flash'> |
|||
<% if flash.any? %> |
|||
<h2 class='bold text-2xl'>FLASH</h2> |
|||
<ul> |
|||
<li> |
|||
<% if flash.key?(:alert) %> |
|||
ALERT = <%= flash.alert %> |
|||
<% end %> |
|||
</li> |
|||
|
|||
<li> |
|||
<% if flash.key?(:notice) %> |
|||
NOTICE = <%= flash.notice %> |
|||
<% end %> |
|||
</li> |
|||
</ul> |
|||
<% end %> |
|||
<div class='flex flex-row gap-4'> |
|||
<button data-action="flash#notice" class='btn btn-primary'>Notice</button> |
|||
<button data-action="flash#alert" class='btn btn-secondary'>Alert</button> |
|||
<button data-action="flash#random" class='btn btn-warning btn-dash'> |
|||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" class="size-[1.2em]"><path stroke-linecap="round" stroke-linejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z" /></svg> |
|||
Random |
|||
</button> |
|||
</div> |
|||
</aside> |
|||
</footer> |
@ -0,0 +1,12 @@ |
|||
<div |
|||
id='flashbar' |
|||
style='max-width: calc(50% - 20px)' |
|||
data-controller='flash' |
|||
data-action="popup-toast@window->flash#popup" data-turbo-permanent |
|||
> |
|||
<!-- |
|||
here is a shadow root which serves as a placeholder for the toaster area. |
|||
max-width gets inherited from this node. |
|||
data-turbo-permant prevents morphing to dismiss active toasts |
|||
--> |
|||
</div> |
@ -0,0 +1,26 @@ |
|||
<footer class="footer sm:footer-horizontal footer-center bg-base-300 text-base-content p-4"> |
|||
<aside> |
|||
<%= Rails.application.name.upcase %> app is free software<br/> |
|||
Copyleft: AGPLv3<br/> |
|||
source code<br/> |
|||
</aside> |
|||
|
|||
<aside> |
|||
<% if flash.any? %> |
|||
<h2 class='bold text-2xl'>FLASH</h2> |
|||
<ul> |
|||
<li> |
|||
<% if flash.key?(:alert) %> |
|||
ALERT = <%= flash.alert %> |
|||
<% end %> |
|||
</li> |
|||
|
|||
<li> |
|||
<% if flash.key?(:notice) %> |
|||
NOTICE = <%= flash.notice %> |
|||
<% end %> |
|||
</li> |
|||
</ul> |
|||
<% end %> |
|||
</aside> |
|||
</footer> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue