Class: Decidim::Proposals::AdminLog::ValueTypes::ProposalTitleBodyPresenter

Inherits:
Log::ValueTypes::DefaultPresenter show all
Includes:
TranslatableAttributes
Defined in:
decidim-proposals/app/presenters/decidim/proposals/admin_log/value_types/proposal_title_body_presenter.rb

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Methods inherited from Log::ValueTypes::DefaultPresenter

#initialize

Constructor Details

This class inherits a constructor from Decidim::Log::ValueTypes::DefaultPresenter

Instance Method Details

#presentObject


10
11
12
13
14
15
16
17
18
# File 'decidim-proposals/app/presenters/decidim/proposals/admin_log/value_types/proposal_title_body_presenter.rb', line 10

def present
  return unless value

  translated_value = translated_attribute(value)
  return if translated_value.blank?

  renderer = Decidim::ContentRenderers::HashtagRenderer.new(translated_value)
  renderer.render(links: false).html_safe
end