Sha256: 4cab759e8a2336262795d447e1cccad791cb95c571e1ac6791a44ed1252825fa

Contents?: true

Size: 737 Bytes

Versions: 15

Compression:

Stored size: 737 Bytes

Contents

require 'omf-web/widget/abstract_widget'

module OMF::Web::Widget::Layout

  # Implements a layout which displays contained widgets in a single columns.
  #
  class OneColumnLayout < OMF::Web::Widget::AbstractWidget

    def initialize(opts)
      super opts
      @widgets = (opts[:widgets] || []).map {|w| OMF::Web::Widget.create_widget(w)}
    end

    def content()
      OMF::Web::Theme.require 'one_column_renderer'
      OMF::Web::Theme::OneColumnRenderer.new(@widgets, @opts)      
    end

    def collect_data_sources(ds_set)
      @widgets.each {|w| w.collect_data_sources(ds_set) }
      ds_set
    end
    
    def name
      @opts[:name] || @opts[:title]
    end
    
    def layout?
      return true
    end

  end 

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
omf_web-1.2.4 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-1.2.3 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-1.2.2 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-1.2.1 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-1.2.0 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-1.0.0 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.9 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.8 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.7 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.6 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.5 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.4 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.3 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9.1 lib/omf-web/widget/layout/one_column_layout.rb
omf_web-0.9 lib/omf-web/widget/layout/one_column_layout.rb