Class: RegistrationPresenter
- Inherits:
-
EventCommonPresenter
- Object
- BasePresenter
- EventCommonPresenter
- RegistrationPresenter
- Defined in:
- app/presenters/registration_presenter.rb
Overview
Instance Method Summary collapse
-
#admin_status_label ⇒ Object
——————————————————————————.
-
#balance_or_paid ⇒ Object
——————————————————————————.
-
#label_published ⇒ Object
——————————————————————————.
-
#start_end_date ⇒ Object
——————————————————————————.
Instance Method Details
#admin_status_label ⇒ Object
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_paid ⇒ Object
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)} — #{model.workshop_price.price_description}'>#{amount}</span>".html_safe else '-' end end |
#label_published ⇒ Object
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_date ⇒ Object
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 |