Add `ModalController#close` action
This commit is contained in:
parent
f30b1b820e
commit
4c393defb7
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class ModalController < ApplicationController
|
||||||
|
include ActionView::Helpers::TagHelper
|
||||||
|
include Turbo::FramesHelper
|
||||||
|
|
||||||
|
skip_before_action :find_active_announcements, :banned?
|
||||||
|
|
||||||
|
def close
|
||||||
|
redirect_to root_path unless turbo_frame_request?
|
||||||
|
render inline: turbo_frame_tag("modal")
|
||||||
|
end
|
||||||
|
end
|
|
@ -32,6 +32,7 @@
|
||||||
= yield
|
= yield
|
||||||
= render "shared/formatting"
|
= render "shared/formatting"
|
||||||
= render "shared/hotkeys"
|
= render "shared/hotkeys"
|
||||||
|
= turbo_frame_tag "modal"
|
||||||
.d-none#toasts
|
.d-none#toasts
|
||||||
- if Rails.env.development?
|
- if Rails.env.development?
|
||||||
#debug
|
#debug
|
||||||
|
|
|
@ -181,5 +181,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
get "/nodeinfo/2.1", to: "well_known/node_info#nodeinfo", as: :node_info
|
get "/nodeinfo/2.1", to: "well_known/node_info#nodeinfo", as: :node_info
|
||||||
|
|
||||||
|
get "/modal/close", to: "modal#close", as: :modal_close
|
||||||
|
|
||||||
puts "processing time of routes.rb: #{"#{(Time.zone.now - start).round(3).to_s.ljust(5, '0')}s".light_green}"
|
puts "processing time of routes.rb: #{"#{(Time.zone.now - start).round(3).to_s.ljust(5, '0')}s".light_green}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue