Sha256: 31e48e6c87dc058d72e960af32a81adf9d099bd35bfcf3693de7a7566c6f161b

Contents?: true

Size: 1.14 KB

Versions: 7

Compression:

Stored size: 1.14 KB

Contents

module Spurs
  module Section
    module Helper
      include ActionView::Helpers::TagHelper

      def spurs_collapsible_section(title,options={},&block)
        opts = Spurs::Section::collapsible_section_default_options.merge(options)
        if !opts[:builder]
          raise "Null builder"
        end

        options_to_pass_to_builder = {}
        builder = opts[:builder].new(options_to_pass_to_builder)
        section_content = capture(nil,&block)
        builder.build_collapsible_section(title.html_safe,section_content.html_safe)
      end

      def spurs_vcenter(options={}, &block)
        opts = options.clone
        if !opts[:class]
          opts[:class] = ""
        end
        opts[:class] = "vcenter_outer ".concat(opts[:class])

        # extract inner options
        inner_opts = opts[:inner_html] ? opts.delete(:inner_html) : {}
        if !inner_opts[:class]
          inner_opts[:class] = ""
        end
        inner_opts[:class].concat(" inner")

        section_content = capture(nil,&block)
        content_tag(:div,content_tag(:div, content_tag(:div,section_content,inner_opts),:class => "middle"),opts)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spurs-0.0.6.rc2 lib/spurs/section/helper.rb
spurs-0.0.5.alpha.4 lib/spurs/section/helper.rb
spurs-0.0.5.alpha.3 lib/spurs/section/helper.rb
spurs-0.0.5.alpha.2 lib/spurs/section/helper.rb
spurs-0.0.5.alpha.1 lib/spurs/section/helper.rb
spurs-0.0.4 lib/spurs/section/helper.rb
spurs-0.0.3 lib/spurs/section/helper.rb