From abadc1e62c9184da4695c1d6d88d6a6c074748be Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet@mmibordeaux.com>
Date: Mon, 17 Apr 2023 17:25:22 +0200
Subject: [PATCH] fixed pages path in pages list

---
 .../communication/blocks/templates/pages/_preview.html.erb  | 6 +++---
 .../communication/blocks/templates/posts/_preview.html.erb  | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb
index 093f0ee87..36bf97d87 100644
--- a/app/views/admin/communication/blocks/templates/pages/_preview.html.erb
+++ b/app/views/admin/communication/blocks/templates/pages/_preview.html.erb
@@ -41,7 +41,7 @@ class_name += " block-pages--" + @block.template.layout
             <% @block.template.selected_pages.each do |page|
               next if page.nil?
             %>
-            <li><%= link_to page, [:admin, page] %></li>
+            <li><%= link_to page, page.url %></li>
             <% end %>
           </ul>
 
@@ -52,7 +52,7 @@ class_name += " block-pages--" + @block.template.layout
             %>
               <article class="card">
                 <h3>
-                  <%= link_to page, [:admin, page] %>
+                  <%= link_to page, page.url %>
                 </h3>
                 <% if @block.template.show_description %>
                   <p><%= page.summary %></p>
@@ -78,7 +78,7 @@ class_name += " block-pages--" + @block.template.layout
             %>
               <article>
                 <h3>
-                  <%= link_to page, [:admin, page] %>  
+                  <%= link_to page, page.url %>  
                 </h3>
                 <% if @block.template.show_description %>
                   <p><%= page.summary %></p>
diff --git a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb
index ab394c4ea..d99f7bbb4 100644
--- a/app/views/admin/communication/blocks/templates/posts/_preview.html.erb
+++ b/app/views/admin/communication/blocks/templates/posts/_preview.html.erb
@@ -54,6 +54,7 @@ highlight_post = @block.template.selected_posts.first
             <% end %>
           <% end %>
         </div>
+
       <% elsif @block.template.layout ===  "highlight" %>
         <div class="highlight">
           <div class="highlight-post">
@@ -86,6 +87,7 @@ highlight_post = @block.template.selected_posts.first
                 </div>
               </article>
             </div>
+            
             <div class="list">
             <% if @block.data %>
               <% @block.template.selected_posts.each do |post|
-- 
GitLab