diff --git a/app/controllers/announcement_link_widgets_controller.rb b/app/controllers/announcement_link_widgets_controller.rb index 095b26d..8e9cb85 100644 --- a/app/controllers/announcement_link_widgets_controller.rb +++ b/app/controllers/announcement_link_widgets_controller.rb @@ -1,5 +1,12 @@ class AnnouncementLinkWidgetsController < ApplicationController + layout false def widget + { + "extras" => {} + } + end + + def render_content announcement_app = ModuleApp.find_by_key("announcement") link_app = ModuleApp.find_by_key("web_resource") OrbitHelper.override_widget_module_app("announcement") @@ -62,5 +69,12 @@ class AnnouncementLinkWidgetsController < ApplicationController "heading-links" => "Links" } } + + end + + def content + OrbitHelper.register_subpart(params["sub_part_id"]) + html = render_widget_for_frontend("announcement_link_widget","render_content","content") + render :html => html.html_safe end end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 3b94a2c..ca0a965 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,2 +1,9 @@ -AnnouncementLinkWidget::Engine.routes.draw do +Rails.application.routes.draw do + + locales = Site.first.in_use_locales rescue I18n.available_locales + + # scope "(:locale)", locale: Regexp.new(locales.join("|")) do + get "/xhr/announcement_link_widget/content" => "announcement_link_widgets#content" + # end + end