Class: Decidim::ContentBlocks::CtaCell
- Inherits:
-
ViewModel
- Object
- ViewModel
- Decidim::ContentBlocks::CtaCell
- Includes:
- SanitizeHelper
- Defined in:
- decidim-core/app/cells/decidim/content_blocks/cta_cell.rb
Instance Method Summary collapse
- #background_image ⇒ Object
- #button_url ⇒ Object
- #cta_button ⇒ Object
- #show ⇒ Object
- #translated_button_text ⇒ Object
- #translated_description ⇒ Object
Instance Method Details
#background_image ⇒ Object
30 31 32 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 30 def background_image model.images_container.attached_uploader(:background_image).path(variant: :big) end |
#button_url ⇒ Object
22 23 24 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 22 def @button_url ||= model.settings. end |
#cta_button ⇒ Object
26 27 28 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 26 def link_to , , class: "button button--sc medium-6", title: end |
#show ⇒ Object
8 9 10 11 12 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 8 def show return if .blank? render end |
#translated_button_text ⇒ Object
14 15 16 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 14 def @translated_button_text ||= translated_attribute(model.settings.) end |
#translated_description ⇒ Object
18 19 20 |
# File 'decidim-core/app/cells/decidim/content_blocks/cta_cell.rb', line 18 def translated_description @translated_description ||= decidim_sanitize_editor_admin(translated_attribute(model.settings.description)) end |