app/components/express_admin/pane.rb in express_admin-1.2.1 vs app/components/express_admin/pane.rb in express_admin-1.3.0

- old
+ new

@@ -1,37 +1,40 @@ require File.join(File.dirname(__FILE__), 'layout_component') module ExpressAdmin class Pane < LayoutComponent - emits -> { - div(dom_id, class: classes) { + emits -> (block) { + div(id: dom_id, class: pane_classes) { heading if title || status - _yield + block.call(self) if block } } def heading - h2.title { - null_wrap { title } - span.status(status) if status + h4(class: 'title') { + current_arbre_element.add_child title + if status + span(class: 'status') { status } + end } end def dom_id nil end def title - @config[:title] || '' + config[:title] || '' end def status - @config[:status] || nil + config[:status] || nil end - def classes - super << " #{@config[:id]}" + def pane_classes + add_class config[:id].to_s + class_names end end end