Class: NfgUi::Components::Patterns::Tile
- Inherits:
-
Base
- Object
- Bootstrap::Components::Base
- Base
- NfgUi::Components::Patterns::Tile
- Includes:
- Bootstrap::Utilities::Collapsible, Traits::Collapse, Utilities::Iconable, Utilities::Titleable
- Defined in:
- lib/nfg_ui/components/patterns/tile.rb
Overview
Tile doc coming soon
Constant Summary
Constants included from Traits::Collapse
Constants included from Traits
Traits::REGISTERED_TRAITS, Traits::TRAIT_MODULES
Instance Attribute Summary
Attributes inherited from Bootstrap::Components::Base
#body, #options, #view_context
Instance Method Summary collapse
Methods included from Traits::Collapse
#collapsed_trait, #collapsible_trait, #navbar_trait
Methods included from Utilities::Titleable
Methods included from Utilities::Iconable
Methods included from Bootstrap::Utilities::Collapsible
#collapse, #collapsed, #collapsible
Methods included from Utilities::Traitable
Methods included from Utilities::Renderable
Methods included from Utilities::Describable
Methods inherited from Bootstrap::Components::Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
19 20 21 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 19 def component_family :tile end |
#heading ⇒ Object
15 16 17 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 15 def heading .fetch(:heading, nil) end |
#render ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 27 def render super do if render_in_body if title.present? concat(NfgUi::Components::Patterns::TileHeader.new({ title: title, icon: icon, collapsible: collapsible, collapse: ("#collapse_#{id}" if collapsible) }, view_context).render) end if collapsible concat(NfgUi::Components::Patterns::Collapse.new({ id: "collapse_#{id}", collapsed: collapsed }, view_context).render { NfgUi::Components::Patterns::TileBody.new({ heading: heading }, view_context).render do (block_given? ? yield : body) end }) else concat(NfgUi::Components::Patterns::TileBody.new({ heading: heading }, view_context).render { (block_given? ? yield : body) }) end else (block_given? ? yield : body) end end end |
#render_in_body ⇒ Object
23 24 25 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 23 def render_in_body .fetch(:render_in_body, true) end |