Class: Decidim::Meetings::MeetingMCell

Inherits:
CardMCell
  • Object
show all
Includes:
MeetingCellsHelper
Defined in:
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 MeetingsHelper

#author_presenter_for, #calculate_start_and_end_time_of_agenda_items, #current_user_groups?, #display_duration_agenda_items, #google_calendar_event_url, #meeting_description, #meeting_type_badge_css_class, #registration_code_help_text, #validation_state_for

Methods included from ApplicationHelper

#activity_filter_values, #filter_date_values, #filter_origin_values, #filter_type_values, #iframe_embed_or_live_event_page?, #online_or_hybrid_meeting?, #prevent_timeout_seconds, #render_meeting_body, #safe_content?

Methods included from MapHelper

#meetings_data_for_map

Instance Method Details

#addressObject



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

def address
  decidim_html_escape(render)
end

#badgeObject



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

def badge
  render if has_badge?
end

#dateObject



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

def date
  render
end

#descriptionObject



30
31
32
# File '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 'app/cells/decidim/meetings/meeting_m_cell.rb', line 10

def has_authors?
  true
end

#has_badge?Boolean

Returns:

  • (Boolean)


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

def has_badge?
  withdrawn?
end

#render_authorshipObject



14
15
16
# File '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 'app/cells/decidim/meetings/meeting_m_cell.rb', line 42

def state_classes
  ["alert"]
end

#titleObject



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

def title
  present(model).title
end