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
- #button ⇒ Object
- #component_family ⇒ Object
- #heading ⇒ Object
- #href ⇒ Object
- #render ⇒ Object
- #render_in_body ⇒ Object
- #subtitle ⇒ Object
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, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#button ⇒ Object
19 20 21 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 19 def .fetch(:button, nil) end |
#component_family ⇒ Object
27 28 29 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 27 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 |
#href ⇒ Object
23 24 25 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 23 def href .fetch(:href, nil) end |
#render ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 35 def render super do if render_in_body if title.present? concat(NfgUi::Components::Patterns::TileHeader.new({ title: title, subtitle: subtitle, button: , href: href, icon: icon, collapsible: collapsible, collapsed: collapsed, 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
31 32 33 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 31 def render_in_body .fetch(:render_in_body, true) end |
#subtitle ⇒ Object
58 59 60 |
# File 'lib/nfg_ui/components/patterns/tile.rb', line 58 def subtitle .fetch(:subtitle, nil) end |