Sha256: 455f2dad8e18ad3a4c314de1892af696996a92f29eecb6385b0952971bbdf267
Contents?: true
Size: 1.33 KB
Versions: 44
Compression:
Stored size: 1.33 KB
Contents
# frozen_string_literal: true require "cell/partial" module Decidim module NewsletterTemplates class ImageTextCtaCell < BaseCell def show render :show end def introduction parse_interpolations(uninterpolated_introduction, recipient_user, newsletter.id) end def uninterpolated_introduction translated_attribute(model.settings.introduction) end def body parse_interpolations(uninterpolated_body, recipient_user, newsletter.id) end def uninterpolated_body translated_attribute(model.settings.body) end def has_cta? cta_text.present? && cta_url.present? end def cta_text parse_interpolations( translated_attribute(model.settings.cta_text), recipient_user, newsletter.id ) end def cta_url translated_attribute(model.settings.cta_url) end def has_main_image? newsletter.template.images_container.main_image.attached? end def main_image image_tag main_image_url end def main_image_url newsletter.template.images_container.attached_uploader(:main_image).url(host: organization.host) end def organization_primary_color organization.colors["primary"] end end end end
Version data entries
44 entries across 44 versions & 1 rubygems