diff --git a/app/views/admin/communication/blocks/templates/video/_preview.html.erb b/app/views/admin/communication/blocks/templates/video/_preview.html.erb index 90d7d4e4a358338828c1d314c1d7ec0ef5a85357..472bc7754cdfe19d85e7ea3a8dca5a2460c3184e 100644 --- a/app/views/admin/communication/blocks/templates/video/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/video/_preview.html.erb @@ -1,11 +1,40 @@ -<% if @block.template.video_title %> - <div class="top"> - <h2><%= block_component_preview :video_title %></h2> +<% +$class = "block block-video" +unless @block.title.empty? + $class += " block-with-title" +end +%> +<section class="<%= $class %>"> + <div class="container"> + <div class="block-content"> + <% unless @block.title.empty? %> + <div class="top"> + <h2><%= @block.title %></h2> + </div> + <% end %> + <% if @block.template.url %> + <div class="video"> + <%# TODO: identification du provider de la vidéo %> + <iframe + src="<%= block_component_preview :url %>" + title="<%= @block.template.video_title %>" + loading="lazy" + ></iframe> + </div> + <% end %> + <% if @block.template.video_title %> + <p><%= @block.template.video_title %></p> + <% end %> + <% if @block.template.transcription %> + <div class="transcription"> + <details> + <summary><%= t 'accessibility.transcription' %></summary> + <p> + <%= @block.template.transcription %> + </p> + </details> + </div> + <% end %> + </div> </div> -<% end %> -<% if @block.template.url %> - <div class="video"> - <%= block_component_preview :url %> - </div> -<% end %> -<%= block_component_preview :transcription %> +</section> \ No newline at end of file diff --git a/config/locales/communication/fr.yml b/config/locales/communication/fr.yml index 827b5f231f299cb081e470dc4055329de9e73113..cf102a79bff67b65514f5cf5722cd3717a419ed1 100644 --- a/config/locales/communication/fr.yml +++ b/config/locales/communication/fr.yml @@ -1,4 +1,6 @@ fr: + accessibility: + transcription: Transcription activemodel: models: communication: Communication