Sha256: cfa3b9d03d04a1c2c5f1d9c4c88d8aef69bbd6166bb5e0c7f16186ed3842e7a2

Contents?: true

Size: 889 Bytes

Versions: 4

Compression:

Stored size: 889 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module ContentBlocks
      module LandingPage
        class DescriptionCell < Decidim::ViewModel
          include Decidim::SanitizeHelper

          delegate :current_participatory_space, to: :controller

          private

          def introductory_image
            current_participatory_space.attached_uploader(:introductory_image)
          end

          def description_text
            decidim_sanitize_editor(translated_attribute(current_participatory_space.description))
          end

          def button_show_more_text
            t(:show_more, scope: "decidim.votings.content_blocks.landing_page.description")
          end

          def button_show_less_text
            t(:show_less, scope: "decidim.votings.content_blocks.landing_page.description")
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
decidim-elections-0.26.1 app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb
decidim-elections-0.26.0 app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb
decidim-elections-0.26.0.rc2 app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb
decidim-elections-0.26.0.rc1 app/cells/decidim/votings/content_blocks/landing_page/description_cell.rb