Sha256: e3394efad59f97db365852e081f1400d200671b171932321df3630e35e00eea7

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

module PageflowPaged
  # Render opt-in placeholders for embeds and opt-out hints.
  module ThirdPartyEmbedConsentHelper
    include Pageflow::EntriesHelper

    def third_party_embed_opt_in(entry:, vendor_name:, message:)
      link_html = third_party_embed_privacy_link(
        entry: entry,
        text: t('pageflow.public.third_party_embed_consent.opt_in.more_information'),
        vendor_name: vendor_name
      )

      render('pageflow_paged/third_party_embed_consent/opt_in',
             message: message,
             vendor_name: vendor_name,
             link_html: link_html)
    end

    def third_party_embed_opt_out_info(entry)
      link_html = third_party_embed_privacy_link(
        entry: entry,
        text: t('pageflow.public.third_party_embed_consent.opt_out_info.prompt_link')
      )

      render('pageflow_paged/third_party_embed_consent/opt_out_info', link_html: link_html)
    end

    def third_party_embed_privacy_link(entry:, text:, vendor_name: nil)
      params = vendor_name ? "&vendors=#{vendor_name}" : ''

      link_to(
        text,
        "#{entry_privacy_link_url(entry)}#{params}#consent",
        target: '_blank', rel: 'noopener noreferrer'
      )
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pageflow-17.0.4 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-17.0.3 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-17.0.2 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-17.0.1 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-17.0.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-16.2.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-16.1.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-16.0.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-15.8.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-15.7.1 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb
pageflow-15.7.0 entry_types/paged/app/helpers/pageflow_paged/third_party_embed_consent_helper.rb