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
20 21 22 23 24 25 26 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 20 def if model.official? Decidim::Core::OfficialAuthorPresenter.new else model..presenter end end |
#description ⇒ Object
32 33 34 35 36 37 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 32 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
16 17 18 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 16 def has_description? true end |
#title ⇒ Object
28 29 30 |
# File 'app/cells/decidim/debates/debate_l_cell.rb', line 28 def title presenter.title(html_escape: true) end |