Class: Decidim::Proposals::ProposalPresenter

Inherits:
SimpleDelegator
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper
Defined in:
app/presenters/decidim/proposals/proposal_presenter.rb

Overview

Decorator for proposals

Instance Method Summary collapse

Instance Method Details

#authorObject



12
13
14
15
16
17
18
19
20
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 12

def author
  @author ||= if official?
                Decidim::Proposals::OfficialAuthorPresenter.new
              elsif user_group
                Decidim::UserGroupPresenter.new(user_group)
              else
                Decidim::UserPresenter.new(super)
              end
end

#display_mentionObject



27
28
29
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 27

def display_mention
  link_to title, proposal_path
end

#proposal_pathObject



22
23
24
25
# File 'app/presenters/decidim/proposals/proposal_presenter.rb', line 22

def proposal_path
  proposal = __getobj__
  Decidim::ResourceLocatorPresenter.new(proposal).path
end