From 17e1f654c82efb39412fb211d36fb9f067e5f138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com> Date: Mon, 13 Mar 2023 14:58:00 +0100 Subject: [PATCH] is_carousel in image component preview --- .../communication/blocks/components/image/_preview.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 066284dac..8d40fa51a 100644 --- a/app/views/admin/communication/blocks/components/image/_preview.html.erb +++ b/app/views/admin/communication/blocks/components/image/_preview.html.erb @@ -1,9 +1,10 @@ <% blob = component.blob return unless blob +is_carousel = @block.template.is_a?(Communication::Block::Template::Gallery) && @block.template.layout == "carousel" %> -<figure> +<figure <% if is_carousel %>class="splide__slide"<% end %>> <%= 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? %> -- GitLab