diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_show.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_show.html.erb index 88eef955e3654296e794f8d5002ca2320683f9ac..1d9665b02cd1ea018b719cfa9cea9120862738f0 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_show.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_show.html.erb @@ -11,7 +11,10 @@ call_to_action_class += ' call_to_action--with-title' unless block.title.blank? <%= render 'admin/communication/blocks/partials/top', block: block %> <% if block.template.elements %> <div class="actions" <% if block.template.elements.count > 1 %>role="group"<% end %>> - <% block.template.elements.each do |element| %> + <% + block.template.elements.each do |element| + next if element.title.blank? + %> <% if element.title %> <a href="<%= block_component_show block, :url, template: element %>" <% if element.target_blank %> diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_snippet.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_snippet.html.erb index d8666c3fa9c10d4551a1501316389dbb4ea1c82c..513af536f0a310f8e05abce5de84f42eddd541e1 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_snippet.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_snippet.html.erb @@ -1,5 +1,8 @@ <div class="mb-1"><%= block_component_snippet block, :text %></div> -<% block.template.elements.each_with_index do |element, index| %> +<% +block.template.elements.each_with_index do |element, index| + next if element.title.blank? + %> <a class="btn disabled <%= index.zero? ? 'btn-dark' : 'btn-light' %>"> <%= block_component_snippet block, :title, template: element %> </a> diff --git a/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb b/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb index b760fc32a853ea918d7ab668297a7e963085bc4d..338944e386d270e6f90d1de4eec7410a9e9707a0 100644 --- a/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb +++ b/app/views/admin/communication/blocks/templates/call_to_action/_static.html.erb @@ -4,9 +4,11 @@ <%= block_component_static block, :alt %> <%= block_component_static block, :credit %> buttons: -<% block.template.elements.each do |element| %> +<% +block.template.elements.each do |element| + next if element.title.blank? + %> <%= block_component_static block, :title, template: element, list: true, depth: 4 %> <%= block_component_static block, :url, template: element, depth: 5 %> <%= block_component_static block, :target_blank, template: element, depth: 5 %> - <% end %>