Class: Decidim::Conferences::ConferenceInvitePresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
decidim-conferences/app/presenters/decidim/conferences/conference_invite_presenter.rb

Overview

Decorator for conference invites

Instance Method Summary collapse

Instance Method Details

#statusObject


9
10
11
12
13
14
15
# File 'decidim-conferences/app/presenters/decidim/conferences/conference_invite_presenter.rb', line 9

def status
  return I18n.t("accepted", scope: "decidim.conferences.models.conference_invite.status", at: I18n.l(accepted_at, format: :decidim_short)) if accepted_at.present?
  return I18n.t("rejected", scope: "decidim.conferences.models.conference_invite.status", at: I18n.l(rejected_at, format: :decidim_short)) if rejected_at.present?
  return I18n.t("sent", scope: "decidim.conferences.models.conference_invite.status") if sent_at.present?

  "-"
end

#status_html_classObject


17
18
19
20
21
22
23
# File 'decidim-conferences/app/presenters/decidim/conferences/conference_invite_presenter.rb', line 17

def status_html_class
  return "success" if accepted_at.present?
  return "danger" if rejected_at.present?
  return "warning" if sent_at.present?

  ""
end