From 8285300339f967f163010dbcc641847fc76d4863 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Wed, 27 Jul 2022 22:26:52 +0200 Subject: [PATCH] better preview --- .../websites/pages/preview.html.erb | 20 ++----------------- .../websites/posts/preview.html.erb | 20 ++----------------- app/views/admin/layouts/preview.html.erb | 18 +++++++++++++++++ 3 files changed, 22 insertions(+), 36 deletions(-) diff --git a/app/views/admin/communication/websites/pages/preview.html.erb b/app/views/admin/communication/websites/pages/preview.html.erb index 1e119534c..76adfeda0 100644 --- a/app/views/admin/communication/websites/pages/preview.html.erb +++ b/app/views/admin/communication/websites/pages/preview.html.erb @@ -1,19 +1,3 @@ -<header class="hero"> - <%= kamifusen_tag @page.best_featured_image if @page.best_featured_image.attached? %> - <div class="container"> - <div> - <h1><%= @page.title %></h1> - </div> - <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> - <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <a itemprop="item"><span itemprop="name">Accueil</span></a> - <meta itemprop="position" content="1"> - </li> - <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <span itemprop="name"><%= @page.title %></span> - <meta itemprop="position" content="2"> - </li> - </ol> - </div> -</header> +<% content_for :title, @page.title %> +<% content_for :image, kamifusen_tag(@page.best_featured_image) if @page.best_featured_image.attached? %> <%= render 'admin/communication/blocks/preview', about: @page %> diff --git a/app/views/admin/communication/websites/posts/preview.html.erb b/app/views/admin/communication/websites/posts/preview.html.erb index 5b376edcd..14bd7cd48 100644 --- a/app/views/admin/communication/websites/posts/preview.html.erb +++ b/app/views/admin/communication/websites/posts/preview.html.erb @@ -1,19 +1,3 @@ -<header class="hero"> - <%= kamifusen_tag @post.featured_image if @post.featured_image.attached? %> - <div class="container"> - <div> - <h1><%= @post.title %></h1> - </div> - <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> - <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <a itemprop="item"><span itemprop="name">Accueil</span></a> - <meta itemprop="position" content="1"> - </li> - <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> - <span itemprop="name"><%= @post.title %></span> - <meta itemprop="position" content="2"> - </li> - </ol> - </div> -</header> +<% content_for :title, @post.title %> +<% content_for :image, kamifusen_tag(@post.featured_image) if @post.featured_image.attached? %> <%= render 'admin/communication/blocks/preview', about: @post %> diff --git a/app/views/admin/layouts/preview.html.erb b/app/views/admin/layouts/preview.html.erb index 791854a7d..4cbc9559f 100644 --- a/app/views/admin/layouts/preview.html.erb +++ b/app/views/admin/layouts/preview.html.erb @@ -11,6 +11,24 @@ <% end %> </head> <body> + <header class="hero"> + <%= yield :image %> + <div class="container"> + <div> + <h1><%= yield :title %></h1> + </div> + <ol class="breadcrumb" itemscope="" itemtype="https://schema.org/BreadcrumbList"> + <li class="breadcrumb-item" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> + <a itemprop="item"><span itemprop="name">Accueil</span></a> + <meta itemprop="position" content="1"> + </li> + <li class="breadcrumb-item active" aria-current="page" itemprop="itemListElement" itemscope="" itemtype="https://schema.org/ListItem"> + <span itemprop="name"><%= yield :title %></span> + <meta itemprop="position" content="2"> + </li> + </ol> + </div> + </header> <main class="page-with-blocks" id="main" role="main" tabindex="-1"> <div class="blocks"> <%= yield %> -- GitLab