Enable restitution of morphed messages

This commit is contained in:
Corinne Durrmeyer 2024-10-23 14:57:55 +02:00
parent c91d8698bd
commit f3d0968da1
No known key found for this signature in database
GPG key ID: DDC049DDA35585B6
2 changed files with 6 additions and 4 deletions

View file

@ -1,5 +1,5 @@
#flash_messages
#flash_message.center
#flash_messages{ tabindex: '-1' }
#flash_message.center{ class: defined?(unique_classname) ? unique_classname : '' }
- if flash.any?
- flash.each do |key, value|
- sticky = defined?(sticky) ? sticky : false

View file

@ -1,7 +1,9 @@
- if flash.any?
= turbo_stream.replace 'flash_messages', partial: 'layouts/flash_messages'
- unique_classname= "u#{SecureRandom.hex}"
= turbo_stream.replace 'flash_messages', partial: 'layouts/flash_messages', locals: { unique_classname: }
= turbo_stream.focus 'flash_messages'
= turbo_stream.show 'flash_messages'
= turbo_stream.hide 'flash_messages', delay: 30000
= turbo_stream.hide_all ".#{unique_classname}", delay: 15000
- flash.clear
= yield