diff --git a/app/views/admin/communication/blocks/components/image/_preview.html.erb b/app/views/admin/communication/blocks/components/image/_preview.html.erb index b6b9532baeb829af5314bf474d58e3b9d7231ead..066284dacd6ac732d54134f96f4aec796f0584fe 100644 --- a/app/views/admin/communication/blocks/components/image/_preview.html.erb +++ b/app/views/admin/communication/blocks/components/image/_preview.html.erb @@ -4,7 +4,7 @@ return unless blob %> <figure> - <%= kamifusen_tag blob, width: 600, class: 'img-fluid mb-1', alt: component.template.alt %> + <%= kamifusen_tag blob, width: 600, class: 'img-fluid mb-1', alt: component.template.try(:alt).blank? ? "" : component.template.alt %> <figcaption> <%= sanitize component.template.credit if component.template.try(:credit).present? %> </figcaption> diff --git a/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb b/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb index 0b3afca9bdcf944fcd274366dbd02bfbd47d8f73..8bc4c337f1455b78f9a78c212ba58695ef909f7d 100644 --- a/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/testimonials/_preview.html.erb @@ -1,14 +1,14 @@ <% - $class = "block block-testimonials" + class_name = "block block-testimonials" unless @block.title.blank? - $class += " block-with-title" + class_name += " block-with-title" end if !@block.template.elements.one? - $class += " with-carousel" + class_name += " with-carousel" end %> -<section class="<%= $class %>"> +<section class="<%= class_name %>"> <div class="container"> <div class="block-content"> <div class="testimonials"> @@ -41,12 +41,14 @@ <%= kamifusen_tag element_blob, width: 600, class: 'img-fluid mb-1', alt: element.author %> </div> <% end %> - <% if element.author %> - <span class="signature"><%= block_component_preview :author, template: element %></span> - <% end %> - <% if element.job %> - <span class="meta"><%= block_component_preview :job, template: element %></span> - <% end %> + <p> + <% if element.author %> + <span class="signature"><%= block_component_preview :author, template: element %></span> + <% end %> + <% if element.job %> + <span class="meta"><%= block_component_preview :job, template: element %></span> + <% end %> + </p> </figcaption> </figure> <% end %> diff --git a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb index d52b51e2b9e76058476b0742e94d2239aa8d34ee..ff8f7921a6131a2a9963d9a012c45f47fe15284b 100644 --- a/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/timeline/_preview.html.erb @@ -20,8 +20,10 @@ <article class="event"> <h3 class="event-title"> <%= block_component_preview :title, template: element %> - <h3> - <p><%= block_component_preview :text, template: element %></p> + </h3> + + <%# TODO: gƩrer les sauts de ligne %> + <p><%= element.text %></p> </article> <% end %> </div> @@ -37,7 +39,7 @@ <li class="event"> <p class="title"><%= block_component_preview :title, template: element %><p> <div class="line"></div> - <p class="description"><%= block_component_preview :text, template: element %></p> + <div class="description"><%= block_component_preview :text, template: element %></div> </li> <% end %> </ol>