Module: ContentBlockTools::Presenters::BlockPresenters::Contact::BlockLevelContactItem
- Included in:
- AddressPresenter, ContactFormPresenter, EmailAddressPresenter, TelephonePresenter
- Defined in:
- lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb
Constant Summary collapse
- BASE_TAG_TYPE =
:div
Instance Method Summary collapse
- #initialize(item, content_block:, rendering_context: :block, **_args) ⇒ Object
- #title ⇒ Object
- #wrapper(&block) ⇒ Object
Instance Method Details
#initialize(item, content_block:, rendering_context: :block, **_args) ⇒ Object
8 9 10 11 12 |
# File 'lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb', line 8 def initialize(item, content_block:, rendering_context: :block, **_args) @item = item @content_block = content_block @rendering_context = rendering_context end |
#title ⇒ Object
25 26 27 28 29 |
# File 'lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb', line 25 def title content_tag(:p, @content_block.title, class: "govuk-!-margin-bottom-3") end |
#wrapper(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb', line 14 def wrapper(&block) if @rendering_context == :field_names content_tag(:div, class: "contact") do concat title concat yield block end else yield block end end |