12 changed files with 112 additions and 77 deletions
-
1.vscode/extensions.json
-
2.vscode/settings.json
-
16app/controllers/application_controller.rb
-
43app/controllers/notification_controller.rb
-
6app/views/layouts/application.html.erb
-
6app/views/layouts/components/_flash.html.erb
-
13app/views/layouts/components/_flashbar.html.erb
-
6app/views/layouts/components/_footer.html.erb
-
2app/views/layouts/components/_navbar.html.erb
-
3app/views/notification/_turbo_placeholder.html.erb
-
3app/views/notification/_turbo_placeholder2.html.erb
-
44app/views/notification/index.html.erb
@ -1,4 +1,20 @@ |
|||||
class ApplicationController < ActionController::Base |
class ApplicationController < ActionController::Base |
||||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. |
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. |
||||
allow_browser versions: :modern |
allow_browser versions: :modern |
||||
|
|
||||
|
def render_stream(notice: nil, alert: nil, &) |
||||
|
flash.now[:notice] = notice if notice |
||||
|
flash.now[:alert] = alert if alert |
||||
|
streams = [] |
||||
|
streams << turbo_stream.replace(:flash, partial: 'layouts/components/flash') if flash.any? |
||||
|
if block_given? |
||||
|
yields = yield(turbo_stream) |
||||
|
if yields.is_a? Array |
||||
|
streams += yields |
||||
|
else |
||||
|
streams << yields |
||||
|
end |
||||
|
end |
||||
|
render turbo_stream: streams |
||||
|
end |
||||
end |
end |
||||
@ -1,7 +1,7 @@ |
|||||
<footer class="footer sm:footer-horizontal footer-center bg-base-300 text-base-content p-4"> |
<footer class="footer sm:footer-horizontal footer-center bg-base-300 text-base-content p-4"> |
||||
<aside> |
<aside> |
||||
<%= Rails.application.name.upcase %> app is free software<br/> |
|
||||
Copyleft: AGPLv3<br/> |
|
||||
source code<br/> |
|
||||
|
<%= Rails.application.name.upcase %> app is free software<br> |
||||
|
Copyleft: AGPLv3<br> |
||||
|
source code<br> |
||||
</aside> |
</aside> |
||||
</footer> |
</footer> |
||||
@ -0,0 +1,3 @@ |
|||||
|
<%= turbo_frame_tag :turbo_placeholder do %> |
||||
|
<%= Time.now %> |
||||
|
<% end %> |
||||
@ -0,0 +1,3 @@ |
|||||
|
<%= turbo_frame_tag :turbo_placeholder2 do %> |
||||
|
<%= Time.now %> |
||||
|
<% end %> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue