Module: Voluntary::WizardHelper

Defined in:
app/helpers/voluntary/wizard_helper.rb

Instance Method Summary collapse

Instance Method Details

#section_header(wizard_step) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'app/helpers/voluntary/wizard_helper.rb', line 3

def section_header(wizard_step)
  wizard_step_index = wizard_steps.index(wizard_step) + 1
  
  content = ["#{wizard_step_index} / #{wizard_steps.length}"] 
  content << t("stories.steps.#{wizard_step}.title")
  content << (future_step?(wizard_step) ? t('general.not_available') : '')
  
  content.join(' ')
end

#step_pane(wizard_step) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/voluntary/wizard_helper.rb', line 13

def step_pane(wizard_step)
  return if future_step?(wizard_step)  
  
  partial_path = wizard_step == :initialization ? 'form' : "steps/#{wizard_step}"
  
  if @presenter.respond_to?(wizard_step)
    @step_presenter = @presenter.send(wizard_step) 
  else
    @step_presenter = nil
  end
  
  render_product_specific_partial_if_available(
    resource, "#{controller_name}/#{partial_path}"
  )
end