Class: Decidim::Meetings::InvitePresenter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
app/presenters/decidim/meetings/invite_presenter.rb

Overview

Decorator for meeting invites

Instance Method Summary collapse

Instance Method Details

#statusObject



9
10
11
12
13
14
15
# File 'app/presenters/decidim/meetings/invite_presenter.rb', line 9

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

  "-"
end

#status_html_classObject



17
18
19
20
21
22
23
# File 'app/presenters/decidim/meetings/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