diff --git a/app/controllers/admin/communication/websites/menus_controller.rb b/app/controllers/admin/communication/websites/menus_controller.rb index f738bbb5e0f4004db87fe9095973069f01a050b9..01c5d9df6d49a659b1b347e9d4f7c0c61fb50874 100644 --- a/app/controllers/admin/communication/websites/menus_controller.rb +++ b/app/controllers/admin/communication/websites/menus_controller.rb @@ -14,6 +14,11 @@ class Admin::Communication::Websites::MenusController < Admin::Communication::We breadcrumb end + def static + @about = @menu + render layout: false + end + def new @menu.website = @website breadcrumb diff --git a/app/views/admin/communication/websites/menus/show.html.erb b/app/views/admin/communication/websites/menus/show.html.erb index 458f9088ac4e363cad0bbb4290ca1da564e29583..dc23ad95368cab901ab517bfbbd3bcee43c2bb9e 100644 --- a/app/views/admin/communication/websites/menus/show.html.erb +++ b/app/views/admin/communication/websites/menus/show.html.erb @@ -22,6 +22,7 @@ <% content_for :action_bar_left do %> <%= destroy_link @menu %> + <%= static_link static_admin_communication_website_menu_path(@menu) %> <% end %> <% content_for :action_bar_right do %> diff --git a/app/views/admin/communication/websites/menus/static.html.erb b/app/views/admin/communication/websites/menus/static.html.erb index 7fded16b3823b2133490c4fe4b637e2a51a18dd2..e8ce01e9054a239d70aaab91e73c636557bb1da8 100644 --- a/app/views/admin/communication/websites/menus/static.html.erb +++ b/app/views/admin/communication/websites/menus/static.html.erb @@ -1,6 +1,13 @@ -<%= raw @about.items - .root - .ordered - .map(&:to_static_hash) - .compact - .to_yaml %> +<% +title = @about.title +items = @about.items + .root + .ordered + .map(&:to_static_hash) + .compact +hash = { + 'title' => title, + 'items' => items +} +%> +<%= raw hash.to_yaml %> diff --git a/config/routes/admin/communication.rb b/config/routes/admin/communication.rb index 6f71dbe89023ffd98121bbd10ab27be17da68965..1e4b5e769f35e002067a223b2224e2d9afecdc85 100644 --- a/config/routes/admin/communication.rb +++ b/config/routes/admin/communication.rb @@ -43,6 +43,9 @@ namespace :communication do end end resources :menus, controller: 'websites/menus', path: '/:lang/menus' do + member do + get :static + end resources :items, controller: 'websites/menus/items', except: :index do collection do get :kind_switch