Class: Decidim::Debates::DebateLCell
- Inherits:
-
CardLCell
- Object
- CardLCell
- Decidim::Debates::DebateLCell
- Includes:
- SanitizeHelper
- Defined in:
- app/cells/decidim/debates/debate_l_cell.rb
Overview
This cell renders the List (:l) debate card for a given instance of a Debate
Instance Method Summary collapse
Instance Method Details
#author_presenter ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 19 def if model.official? Decidim::Core::OfficialAuthorPresenter.new else model..presenter end end |
#description ⇒ Object
31 32 33 34 35 36 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 31 def description attribute = model.try(:short_description) || model.try(:body) || model.description text = translated_attribute(attribute) decidim_sanitize(html_truncate(text, length: 240), strip_tags: true) end |
#has_description? ⇒ Boolean
15 16 17 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 15 def has_description? true end |
#title ⇒ Object
27 28 29 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 27 def title presenter.title(html_escape: true) end |