From 061e0b4bb97a8c5733ca5d4816b1eb1c6403144e Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Mon, 21 Feb 2022 13:47:53 +0100
Subject: [PATCH] static preview

---
 .../communication/website/pages_controller.rb |  5 +++++
 config/routes/admin/communication.rb          | 19 ++++++++++++-------
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/app/controllers/admin/communication/website/pages_controller.rb b/app/controllers/admin/communication/website/pages_controller.rb
index 6588b3a8d..25f582de1 100644
--- a/app/controllers/admin/communication/website/pages_controller.rb
+++ b/app/controllers/admin/communication/website/pages_controller.rb
@@ -31,6 +31,11 @@ class Admin::Communication::Website::PagesController < Admin::Communication::Web
     breadcrumb
   end
 
+  def static
+    @about = @page
+    render layout: false
+  end
+
   def new
     @page.website = @website
     breadcrumb
diff --git a/config/routes/admin/communication.rb b/config/routes/admin/communication.rb
index 87ed08775..5b465162b 100644
--- a/config/routes/admin/communication.rb
+++ b/config/routes/admin/communication.rb
@@ -12,6 +12,7 @@ namespace :communication do
       end
       member do
         get :children
+        get :static
       end
     end
     resources :categories, controller: 'website/categories' do
@@ -24,7 +25,11 @@ namespace :communication do
     end
     resources :authors, controller: 'website/authors', only: [:index, :show]
     resources :posts, controller: 'website/posts'
-    resources :curations, path: 'posts/curations', as: :post_curations, controller: 'website/posts/curations', only: [:new, :create]
+    resources :curations,
+              path: 'posts/curations',
+              as: :post_curations,
+              controller: 'website/posts/curations',
+              only: [:new, :create]
     resources :blocks, controller: 'website/blocks', except: :index do
       collection do
         post :reorder
@@ -41,13 +46,13 @@ namespace :communication do
         end
       end
     end
-    get 'structure' => 'website/structure#edit'
-    patch 'structure' => 'website/structure#update'
+    get   'structure'     => 'website/structure#edit'
+    patch 'structure'     => 'website/structure#update'
 
-    get 'indexes' => 'website/index_pages#index'
-    get 'indexes/:kind' => 'website/index_pages#edit', as: :index
-    post 'indexes/:kind' => 'website/index_pages#update'
+    get   'indexes'       => 'website/index_pages#index'
+    get   'indexes/:kind' => 'website/index_pages#edit', as: :index
+    post  'indexes/:kind' => 'website/index_pages#update'
     patch 'indexes/:kind' => 'website/index_pages#update'
-    put 'indexes/:kind' => 'website/index_pages#update'
+    put   'indexes/:kind' => 'website/index_pages#update'
   end
 end
-- 
GitLab