Class: Decidim::Meetings::MeetingMCell

Inherits:
CardMCell
  • Object
show all
Includes:
MeetingCellsHelper
Defined in:
decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb

Overview

This cell renders the Medium (:m) meeting card for an given instance of a Meeting

Direct Known Subclasses

MeetingSCell, MeetingsMapCell

Instance Method Summary collapse

Methods included from TranslatableAttributes

#default_locale?

Methods inherited from CardMCell

#show

Methods included from CardHelper

#card_for

Instance Method Details

#addressObject


22
23
24
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 22

def address
  decidim_html_escape(render)
end

#badgeObject


34
35
36
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 34

def badge
  render if has_badge?
end

#dateObject


18
19
20
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 18

def date
  render
end

#descriptionObject


30
31
32
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 30

def description
  present(model).description(strip_tags: true).truncate(120, separator: /\s/)
end

#has_authors?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 10

def has_authors?
  true
end

#has_badge?Boolean

Returns:

  • (Boolean)

38
39
40
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 38

def has_badge?
  withdrawn?
end

#render_authorshipObject


14
15
16
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 14

def render_authorship
  cell "decidim/author", author_presenter_for(model.normalized_author)
end

#state_classesObject


42
43
44
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 42

def state_classes
  ["alert"]
end

#titleObject


26
27
28
# File 'decidim-meetings/app/cells/decidim/meetings/meeting_m_cell.rb', line 26

def title
  present(model).title(html_escape: true)
end