Class: RegistrationPresenter

Inherits:
EventCommonPresenter show all
Defined in:
app/presenters/registration_presenter.rb

Overview


Instance Method Summary collapse

Instance Method Details

#admin_status_labelObject




19
20
21
# File 'app/presenters/registration_presenter.rb', line 19

def admin_status_label
  h.colored_label(model.current_state.to_s.titlecase, "#{model.current_state}")
end

#balance_or_paidObject




24
25
26
27
28
29
30
31
32
# File 'app/presenters/registration_presenter.rb', line 24

def balance_or_paid
  if model.workshop_price && model.workshop_price.price
    color = (model.balance_owed.positive?) ? 'balance_owed' : 'balance_paid'
    amount = (model.balance_owed.zero?) ? 'paid' : model.balance_owed.format(:no_cents_if_whole => true)
    "<span data-placement='left' class='hovertip #{color}' title='#{model.workshop_price.price.format(:no_cents_if_whole => true)} &mdash; #{model.workshop_price.price_description}'>#{amount}</span>".html_safe
  else
    '-'
  end
end

#label_publishedObject




9
10
11
# File 'app/presenters/registration_presenter.rb', line 9

def label_published
  !model.registration_closed? ? h.colored_label(start_end_date, :success) : h.colored_label(start_end_date)
end

#start_end_dateObject




14
15
16
# File 'app/presenters/registration_presenter.rb', line 14

def start_end_date
  format_date_range(model.starting_on, model.ending_on)
end