Class: Decidim::Votings::VotingPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper, SanitizeHelper, TranslatableAttributes
Defined in:
decidim-elections/app/presenters/decidim/votings/voting_presenter.rb

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Methods included from SanitizeHelper

#decidim_html_escape, #decidim_sanitize, #decidim_sanitize_newsletter, #decidim_url_escape, included

Instance Method Details


25
26
27
28
29
# File 'decidim-elections/app/presenters/decidim/votings/voting_presenter.rb', line 25

def banner_image_url
  return if voting.banner_image.blank?

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

#introductory_image_urlObject


19
20
21
22
23
# File 'decidim-elections/app/presenters/decidim/votings/voting_presenter.rb', line 19

def introductory_image_url
  return if voting.introductory_image.blank?

  URI.join(decidim.root_url(host: voting.organization.host), voting.introductory_image_url).to_s
end

#titleObject


14
15
16
17
# File 'decidim-elections/app/presenters/decidim/votings/voting_presenter.rb', line 14

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

#votingObject


31
32
33
# File 'decidim-elections/app/presenters/decidim/votings/voting_presenter.rb', line 31

def voting
  __getobj__
end