Class: Decidim::Debates::DebateMCell

Inherits:
CardMCell
  • Object
show all
Includes:
DebateCellsHelper
Defined in:
decidim-debates/app/cells/decidim/debates/debate_m_cell.rb

Overview

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

Instance Method Summary collapse

Methods included from Comments::CommentsHelper

#comments_for, #inline_comments_for

Methods included from PaginateHelper

#decidim_paginate, #per_page

Methods inherited from CardMCell

#show

Methods included from CardHelper

#card_for

Instance Method Details

#badge_nameObject


18
19
20
# File 'decidim-debates/app/cells/decidim/debates/debate_m_cell.rb', line 18

def badge_name
  I18n.t("decidim.debates.debates.closed") if model.closed?
end

#dateObject


10
11
12
# File 'decidim-debates/app/cells/decidim/debates/debate_m_cell.rb', line 10

def date
  render
end

#has_state?Boolean

Returns:

  • (Boolean)

14
15
16
# File 'decidim-debates/app/cells/decidim/debates/debate_m_cell.rb', line 14

def has_state?
  model.closed?
end

#presenterObject


28
29
30
# File 'decidim-debates/app/cells/decidim/debates/debate_m_cell.rb', line 28

def presenter
  present(model)
end

#state_classesObject


22
23
24
25
26
# File 'decidim-debates/app/cells/decidim/debates/debate_m_cell.rb', line 22

def state_classes
  return ["muted"] if model.closed?

  super
end