module Adminterface::Extensions::Views::Components::Panel

Public Instance Methods

body_html_options() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 44
def body_html_options
  body_html[:class] = "panel_contents #{default_body_class} #{body_html[:class]}".squish
  body_html
end
build_title(title) click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 6
def build_title(title)
  return if title.blank?

  div title.to_s, class: default_title_class
end
default_body_class() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 24
def default_body_class
  "panel-body #{panel_css_classes[:body]}".squish
end
default_header_class() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 20
def default_header_class
  "panel-header #{panel_css_classes.dig(:header, :wrapper)}".squish
end
default_title_class() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 12
def default_title_class
  "title #{panel_css_classes.dig(:header, :title)}".squish
end
default_wrapper_class() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 16
def default_wrapper_class
  "panel #{panel_css_classes[:wrapper]}".squish
end
header_action(*args) { || ... } click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 28
def header_action(*args)
  action = args[0]

  @title << div(class: "header_action") do
    html = []
    html << action
    html << yield if block_given?
    safe_join(html)
  end
end
header_html_options() click to toggle source
# File lib/adminterface/extensions/views/components/panel.rb, line 39
def header_html_options
  header_html[:class] = "#{default_header_class} #{header_html[:class]}".squish
  header_html
end