Sha256: ba273fc7a1bb0d757c743444855fd565a8ebb9757f3d1f7cb7b2e923a34e0bf1

Contents?: true

Size: 603 Bytes

Versions: 52

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Elections
    #
    # Decorator for election
    #
    class ElectionPresenter < SimpleDelegator
      include Decidim::SanitizeHelper
      include Decidim::TranslatableAttributes

      def election
        __getobj__
      end

      def title
        content = translated_attribute(election.title)
        decidim_html_escape(content)
      end

      def description(strip_tags: false)
        content = translated_attribute(election.description)
        content = strip_tags(content) if strip_tags
        content
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
decidim-elections-0.28.4 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.9 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.3 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.8 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.7 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.6 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.10 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.9 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.0 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.5 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.0.rc5 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.28.0.rc4 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.8 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.4 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.3 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.7 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.5 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.2 app/presenters/decidim/elections/election_presenter.rb