Sha256: f62c1dae005eee374f6f18a369470613ef09c3e03942bf9f8655a533727d2e23

Contents?: true

Size: 922 Bytes

Versions: 59

Compression:

Stored size: 922 Bytes

Contents

module Para
  module Markup
    class Panel < Para::Markup::Component
      def container(options = {}, &block)
        merge_class!(options, "panel")

        if (type = options.fetch(:type, 'default'))
          merge_class!(options, "panel-#{ type }")
        end

        content_tag(:div, options) do
          capture { block.call(self) }
        end
      end

      def header(options = {}, &block)
        merge_class!(options, "panel-heading")

        content_tag(:div, options) do
          capture { block.call }
        end
      end

      def body(options = {}, &block)
        merge_class!(options, "panel-body")

        content_tag(:div, options) do
          capture { block.call }
        end
      end

      def footer(options = {}, &block)
        merge_class!(options, "panel-footer")

        content_tag(:div, options) do
          capture { block.call }
        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
para-0.12.4 lib/para/markup/panel.rb
para-0.12.3 lib/para/markup/panel.rb
para-0.12.2 lib/para/markup/panel.rb
para-0.12.1 lib/para/markup/panel.rb
para-0.12.0 lib/para/markup/panel.rb
para-0.11.4 lib/para/markup/panel.rb
para-0.11.3 lib/para/markup/panel.rb
para-0.11.2 lib/para/markup/panel.rb
para-0.11.1 lib/para/markup/panel.rb
para-0.11.0 lib/para/markup/panel.rb
para-0.10.0 lib/para/markup/panel.rb
para-0.9.4 lib/para/markup/panel.rb
para-0.9.3.3 lib/para/markup/panel.rb
para-0.9.3.2 lib/para/markup/panel.rb
para-0.9.3.1 lib/para/markup/panel.rb
para-0.9.2 lib/para/markup/panel.rb
para-0.9.0 lib/para/markup/panel.rb
para-0.8.15 lib/para/markup/panel.rb
para-0.8.14 lib/para/markup/panel.rb
para-0.8.13 lib/para/markup/panel.rb