class Decidim::Debates::DebateMCell
for an given instance of a Debate
This cell renders the Medium (:m) debate card
def badge_name
def badge_name I18n.t("decidim.debates.debates.closed") if model.closed? end
def body
def body decidim_sanitize_editor(present(model).description) end
def date
def date render end
def debate_date
def debate_date return render(:open_date) unless start_date && end_date return render(:multiple_dates) if spans_multiple_dates? render(:single_date) end
def description
def description strip_tags(body).truncate(200, separator: /\s/) end
def end_date
def end_date return unless model.end_time model.end_time.to_date end
def formatted_end_time
def formatted_end_time model.end_time.strftime("%H:%M") end
def formatted_start_time
def formatted_start_time model.start_time.strftime("%H:%M") end
def has_actions?
def has_actions? false end
def has_state?
def has_state? model.closed? end
def presenter
def presenter present(model) end
def resource_icon
def resource_icon icon "debates", class: "icon--big" end
def spans_multiple_dates?
def spans_multiple_dates? start_date != end_date end
def start_date
def start_date return unless model.start_time model.start_time.to_date end
def state_classes
def state_classes return ["muted"] if model.closed? super end
def title
def title presenter.title(html_escape: true) end