Sha256: 3d183ff74d480d67685c40cfb5417600b40057e71c5b2d27d3be7b6a815506e0

Contents?: true

Size: 537 Bytes

Versions: 16

Compression:

Stored size: 537 Bytes

Contents

module ActiveAdmin
  module Views

    class Panel < ActiveAdmin::Component
      builder_method :panel

      def build(title, attributes = {})
        icon_name = attributes.delete(:icon)
        icn = icon_name ? icon(icon_name) : ""
        super(attributes)
        add_class "panel"
        @title = h3(icn + title.to_s)
        @contents = div(:class => "panel_contents")
      end

      def add_child(child)
        if @contents
          @contents << child
        else
          super
        end
      end
    end

  end
end

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
andrewroth_activeadmin-0.3.4.4 lib/active_admin/views/components/panel.rb
andrewroth_activeadmin-0.3.4.3 lib/active_admin/views/components/panel.rb
andrewroth_activeadmin-0.3.4.2 lib/active_admin/views/components/panel.rb
andrewroth_activeadmin-0.3.4.1 lib/active_admin/views/components/panel.rb
andrewroth_activeadmin-0.3.4 lib/active_admin/views/components/panel.rb
activeadmin-0.3.4 lib/active_admin/views/components/panel.rb
activeadmin-0.3.3 lib/active_admin/views/components/panel.rb
activeadmin-0.3.2 lib/active_admin/views/components/panel.rb
activeadmin-0.3.1 lib/active_admin/views/components/panel.rb
activeadmin-0.3.0 lib/active_admin/views/components/panel.rb
nsm-activeadmin-0.2.2 lib/active_admin/views/components/panel.rb
saulolso-activeadmin-0.2.2.1 lib/active_admin/views/components/panel.rb
saulolso-activeadmin-0.2.2 lib/active_admin/views/components/panel.rb
activeadmin-0.2.2 lib/active_admin/views/components/panel.rb
activeadmin-0.2.1 lib/active_admin/views/components/panel.rb
activeadmin-0.2.0 lib/active_admin/views/components/panel.rb