app/presenters/decidim/proposals/proposal_presenter.rb in decidim-proposals-0.10.1 vs app/presenters/decidim/proposals/proposal_presenter.rb in decidim-proposals-0.11.0.pre1

- old
+ new

@@ -4,17 +4,29 @@ module Proposals # # Decorator for proposals # class ProposalPresenter < SimpleDelegator + include Rails.application.routes.mounted_helpers + include ActionView::Helpers::UrlHelper + def author @author ||= if official? Decidim::Proposals::OfficialAuthorPresenter.new elsif user_group Decidim::UserGroupPresenter.new(user_group) else Decidim::UserPresenter.new(super) end + end + + def proposal_path + proposal = __getobj__ + Decidim::ResourceLocatorPresenter.new(proposal).path + end + + def display_mention + link_to title, proposal_path end end end end