Sha256: 1aff9bf9e09ec973e3b254b1a53dccc4f09f6c7ac50ec407ff7a7f3120a1664e

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

require 'bh/classes/panel_row'

module Bh
  module Helpers
    # Wraps a set of Bootstrap-styled panels in a row.
    # @see http://getbootstrap.com/components/#panels
    # @see http://getbootstrap.com/css/#grid
    # @return [String] the HTML to display a row of Bootstrap-styled panels.
    # @param [Hash] options the options for the row. Any option not
    #   listed below is passed as an HTML attribute to the row’s `<div>`.
    # @option options [#to_s] :column_class the class to wrap each panel with.
    #   Useful to specify a grid size for the column such as 'col-sm-4' to
    #   indicate how many columns of the row each panel should occupy.
    # @yieldreturn [#to_s] the panels to display in a row.
    # @example Display a row of two panels with the same width.
    #   panel_row column_class: 'col-sm-6' do
    #     panel 'Panel #1', context: :success
    #     panel 'Panel #2', context: :info
    #   end
    def panel_row(options = {}, &block)
      panel_row = Bh::PanelRow.new self, options, &block
      panel_row.extract! :column_class

      panel_row.append_class! :row
      panel_row.render_tag :div
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bh-1.3.6 lib/bh/helpers/panel_row_helper.rb
bh-1.3.5 lib/bh/helpers/panel_row_helper.rb
bh-1.3.4 lib/bh/helpers/panel_row_helper.rb
bh-1.3.3 lib/bh/helpers/panel_row_helper.rb
bh-1.3.1 lib/bh/helpers/panel_row_helper.rb
bh-1.3.0 lib/bh/helpers/panel_row_helper.rb
bh-1.2.0 lib/bh/helpers/panel_row_helper.rb