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.27.1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.4 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.0 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.3 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.0.rc2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.27.0.rc1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.0 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.0.rc2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.26.0.rc1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.0 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.0.rc4 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.0.rc3 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.0.rc2 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.25.0.rc1 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.24.3 app/presenters/decidim/elections/election_presenter.rb
decidim-elections-0.23.6 app/presenters/decidim/elections/election_presenter.rb