Sha256: 346376e39624c7d948b87e7506881ccfe80734216a4d52cb8fec1f36abb5c474

Contents?: true

Size: 928 Bytes

Versions: 8

Compression:

Stored size: 928 Bytes

Contents

module Voluntary
  module Helpers
    module Wizard
      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
      
      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
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
voluntary-0.1.0 lib/voluntary/helpers/wizard.rb
voluntary-0.1.0.rc4 lib/voluntary/helpers/wizard.rb
voluntary-0.1.0.rc3 lib/voluntary/helpers/wizard.rb
voluntary-0.1.0.rc2 lib/voluntary/helpers/wizard.rb
voluntary-0.1.0.rc1 lib/voluntary/helpers/wizard.rb
voluntary-0.0.3 lib/voluntary/helpers/wizard.rb
voluntary-0.0.2 lib/voluntary/helpers/wizard.rb
voluntary-0.0.1 lib/voluntary/helpers/wizard.rb