Skip to content
Snippets Groups Projects
Unverified Commit 0e57af99 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Ajout de la variable screen_reader_only au block top (#2509)

* Screen reader only

* active
parent dc11f9bd
No related branches found
No related tags found
No related merge requests found
module Communication::Block::Template::Base::WithTop
extend ActiveSupport::Concern
def top_active
top_title.present? || top_description.present?
end
def top_title
block.try(:title)
end
def top_description
try(:description)
def top_heading
block.heading_rank_base
end
def top_link
nil
end
def top_heading
block.heading_rank_base
def top_screen_reader_only
false
end
def top_description
try(:description)
end
end
......@@ -2,4 +2,7 @@ class Communication::Block::Template::Testimonial < Communication::Block::Templa
has_elements
def top_screen_reader_only
true
end
end
......@@ -20,6 +20,7 @@ should_render_data = block.data && block.data.present?
html_class: "<%= block.html_class_prepared %>"
<% end %>
top:
active: <%= block.template.top_active %>
<% if block.template.top_title.present? %>
title:
value: >-
......@@ -28,6 +29,9 @@ should_render_data = block.data && block.data.present?
<% if block.template.top_link.present? %>
link: "<%= block.template.top_link %>"
<% end %>
<% if block.template.top_screen_reader_only.present? %>
screen_reader_only: <%= block.template.top_screen_reader_only %>
<% end %>
<% end %>
<% if block.template.top_description.present? %>
description: >-
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment