Sha256: 430417061f87f102fa9f7a41d51ac2f09f69bc6e43b3a89f87a9f06273b5705c

Contents?: true

Size: 666 Bytes

Versions: 6

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module ParticipatoryProcesses
    class ParticipatoryProcessPresenter < SimpleDelegator
      include Rails.application.routes.mounted_helpers
      include ActionView::Helpers::UrlHelper

      def hero_image_url
        return unless process.hero_image_url

        URI.join(decidim.root_url(host: process.organization.host), process.hero_image_url).to_s
      end

      def banner_image_url
        return unless process.banner_image_url

        URI.join(decidim.root_url(host: process.organization.host), process.banner_image_url).to_s
      end

      def process
        __getobj__
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-participatory_processes-0.24.3 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb
decidim-participatory_processes-0.23.6 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb
decidim-participatory_processes-0.24.2 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb
decidim-participatory_processes-0.23.5 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb
decidim-participatory_processes-0.24.1 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb
decidim-participatory_processes-0.24.0 app/presenters/decidim/participatory_processes/participatory_process_presenter.rb