diff --git a/app/views/admin/communication/blocks/templates/sound/_edit.html.erb b/app/views/admin/communication/blocks/templates/sound/_edit.html.erb index ec65c4326fc1cd5652407fec86470084c9ef06ab..68c966a68a16e7bdf6df5f04ee14de5a4cf0b37a 100644 --- a/app/views/admin/communication/blocks/templates/sound/_edit.html.erb +++ b/app/views/admin/communication/blocks/templates/sound/_edit.html.erb @@ -1,10 +1,10 @@ <div class="row pure__row--small"> <div class="col-md-6"> - <%= block_component_edit :file %> - <%= block_component_edit :title %> + <%= block_component_edit block, :file %> + <%= block_component_edit block, :title %> </div> <div class="col-md-6"> - <%= block_component_edit :transcription, + <%= block_component_edit block, :transcription, label: t('admin.communication.blocks.components.text.transcription.label'), placeholder: t('admin.communication.blocks.components.text.transcription.placeholder'), rows: 10 %> </div> diff --git a/app/views/admin/communication/blocks/templates/sound/_preview.html.erb b/app/views/admin/communication/blocks/templates/sound/_show.html.erb similarity index 57% rename from app/views/admin/communication/blocks/templates/sound/_preview.html.erb rename to app/views/admin/communication/blocks/templates/sound/_show.html.erb index d287566753441b75e0d33eff7b3e7974c0444213..274447d6cb2a90c72869eec9ee1ec8a064f782a2 100644 --- a/app/views/admin/communication/blocks/templates/sound/_preview.html.erb +++ b/app/views/admin/communication/blocks/templates/sound/_show.html.erb @@ -1,31 +1,31 @@ <% class_name = "block block-sound" -unless @block.title.blank? +unless block.title.blank? class_name += " block-with-title" end %> <section class="<%= class_name %>"> <div class="container"> <div class="block-content"> - <% unless @block.title.blank? %> + <% unless block.title.blank? %> <div class="top"> - <h2><%= @block.title %></h2> + <h2><%= block.title %></h2> </div> <% end %> - <% if @block.template.file.present? %> - <% blob = @block.template.file_component.blob %> + <% if block.template.file.present? %> + <% blob = block.template.file_component.blob %> <% if blob %> <audio controls src="<%= blob.url %>"></audio> <% end %> <% end %> - <% if @block.template.title %> - <p><%= block_component_preview :title %></p> + <% if block.template.title %> + <p><%= block_component_show block, :title %></p> <% end %> - <% unless @block.template.transcription.blank? %> + <% unless block.template.transcription.blank? %> <div class="transcription"> <details> <summary><%= t 'accessibility.transcription' %></summary> - <p><%= block_component_preview :transcription %></p> + <p><%= block_component_show block, :transcription %></p> </details> </div> <% end %> diff --git a/app/views/admin/communication/blocks/templates/sound/_snippet.html.erb b/app/views/admin/communication/blocks/templates/sound/_snippet.html.erb new file mode 100644 index 0000000000000000000000000000000000000000..33d1ad5987a54223532882e73e6adfb678b0a113 --- /dev/null +++ b/app/views/admin/communication/blocks/templates/sound/_snippet.html.erb @@ -0,0 +1,5 @@ +<p> + <% if block.template.file.present? %> + <%= block.template.file['filename'] %> + <% end %> +</p> \ No newline at end of file