Class: TinyAdmin::Views::Components::Widgets
- Inherits:
-
BasicComponent
- Object
- Phlex::HTML
- BasicComponent
- TinyAdmin::Views::Components::Widgets
- Defined in:
- lib/tiny_admin/views/components/widgets.rb
Instance Method Summary collapse
-
#initialize(widgets) ⇒ Widgets
constructor
A new instance of Widgets.
- #view_template ⇒ Object
Methods inherited from BasicComponent
Constructor Details
#initialize(widgets) ⇒ Widgets
Returns a new instance of Widgets.
7 8 9 |
# File 'lib/tiny_admin/views/components/widgets.rb', line 7 def initialize() @widgets = end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/tiny_admin/views/components/widgets.rb', line 11 def view_template return if @widgets.nil? || @widgets.empty? div(class: 'container widgets') { @widgets.each_slice(2).each do |row| div(class: 'row') { row.each do || next unless < Phlex::HTML div(class: 'col') { div(class: 'card') { div(class: 'card-body') { render .new } } } end } end } end |