Sha256: 21b2a6b300415ef8b85dd7560fb7d9972f204e46c50e9d3c344797bb7e179783

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

module Rao
  module ServiceChain
    # Usage:
    #
    #     # app/controllers/application_controller.rb
    #     class ApplicationController < ActionController::Base
    #       view_helper Rao::Service::Chain::ApplicationViewHelper, as: :service_chain_helper
    #     end
    #
    class ApplicationViewHelper < Rao::ViewHelper::Base
      # Usage:
      #
      #     # app/views/layouts/application.html.haml
      #     !!!
      #     %html{ lang: I18n.locale }
      #       %head
      #         /...
      #       %body
      #         = service_chain_helper(self).render_progress(@service_chain)
      #
      def render_progress(service_chain, options = {})
        return if service_chain.nil?
        
        options = default_options.deep_merge(options)
        theme = options.delete(:theme)

        c.render partial: "rao/service_chain/application_view_helper/render_progress/#{theme}", locals: { service_chain: service_chain, options: options }
      end

      private

      def default_options
        {
          theme: :bootstrap4,
          next_steps: { render_as_pending: false, link: true },
          actual_step: { link: false },
          previous_steps: { render_as_pending: true, link: true }
        }
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rao-service_chain-0.0.52.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.51.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.50.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.49.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.48.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.47.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.46.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.45.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.44.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.43.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.42.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.41.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.40.pre app/view_helpers/rao/service_chain/application_view_helper.rb
rao-service_chain-0.0.39.pre app/view_helpers/rao/service_chain/application_view_helper.rb