Class: OMF::Web::Widget::Layout::TwoColumnsLayout
- Inherits:
-
AbstractWidget
- Object
- Erector::Widget
- AbstractWidget
- OMF::Web::Widget::Layout::TwoColumnsLayout
- Defined in:
- lib/omf-web/widget/layout/two_columns_layout.rb
Overview
Implements a layout which displays contained widgets in two columns.
Instance Attribute Summary
Attributes inherited from AbstractWidget
#opts, #widget_id, #widget_type
Instance Method Summary collapse
- #collect_data_sources(ds_set) ⇒ Object
- #content ⇒ Object
-
#initialize(type, opts) ⇒ TwoColumnsLayout
constructor
A new instance of TwoColumnsLayout.
- #layout? ⇒ Boolean
- #name ⇒ Object
-
#tools_menu ⇒ Object
Return html for an optional widget tools menu to be added to the widget decoration by the theme.
Methods inherited from AbstractWidget
#mime_type, #title, #widget_info
Methods included from Common::Loggable
#_logger, #debug, #error, #fatal, #info, init_log, logger, set_environment, #warn
Constructor Details
#initialize(type, opts) ⇒ TwoColumnsLayout
Returns a new instance of TwoColumnsLayout.
9 10 11 12 13 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 9 def initialize(type, opts) super opts @left = (opts[:left] || []).map {|w| OMF::Web::Widget.(w)} @right = (opts[:right] || []).map {|w| OMF::Web::Widget.(w)} end |
Instance Method Details
#collect_data_sources(ds_set) ⇒ Object
20 21 22 23 24 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 20 def collect_data_sources(ds_set) @left.each {|w| w.collect_data_sources(ds_set) } @right.each {|w| w.collect_data_sources(ds_set) } ds_set end |
#content ⇒ Object
15 16 17 18 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 15 def content() OMF::Web::Theme.require 'two_columns_renderer' OMF::Web::Theme::TwoColumnsRenderer.new(@left, @right, @opts) end |
#layout? ⇒ Boolean
30 31 32 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 30 def layout? return true end |
#name ⇒ Object
26 27 28 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 26 def name @opts[:name] || @active_widget.name end |
#tools_menu ⇒ Object
Return html for an optional widget tools menu to be added to the widget decoration by the theme.
38 39 40 |
# File 'lib/omf-web/widget/layout/two_columns_layout.rb', line 38 def () raise "Why are we here" end |