Sha256: 0a7b3c95d186dfe80fe895ea2f3e6a40eae173be21135c9ffa254a5e4e7b2392
Contents?: true
Size: 782 Bytes
Versions: 5
Compression:
Stored size: 782 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) : "".html_safe 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 # Override children? to only report children when the panel's # contents have been added to. This ensures that the panel # correcly appends string values, etc. def children? @contents.children? end end end end
Version data entries
5 entries across 5 versions & 2 rubygems