Sha256: 2692994cf0bb0229785552088c881d76600f994bca6df2abec6ec0e661d2e9e5

Contents?: true

Size: 1000 Bytes

Versions: 14

Compression:

Stored size: 1000 Bytes

Contents

require 'omf-web/widget/abstract_widget'
require 'omf-web/content/repository'

module OMF::Web::Widget
  
  # Renders the content of a moustache file in the context of a data source
  #
  class MustacheWidget < AbstractWidget
    
    def self.create_mustache_widget(type, wdescr)
      return self.new(wdescr)
    end
    
    attr_accessor :content_proxy
    
    def initialize(opts)
      super opts
      # if (content_descr = opts[:content])
        # opts[:content_proxy] = OMF::Web::ContentRepository.create_content_proxy_for(content_descr, opts)  
      # end  
    end
    
    def title 
      @opts[:title] || 'No Title'
    end
       
    def content()
      OMF::Web::Theme.require 'mustache_renderer'
      OMF::Web::Theme::MustacheRenderer.new(self, @opts)
    end
    
    def collect_data_sources(ds_set)
      if @opts[:data_sources]
        @opts[:data_sources].each do |ds|
          ds_set.add(ds[:stream])
        end
      end
      ds_set
    end
    
  end # class
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
omf_web-1.2.9 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.8 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.7 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.6 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.5 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.4 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.3 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.2 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.1 lib/omf-web/widget/mustache_widget.rb
omf_web-1.2.0 lib/omf-web/widget/mustache_widget.rb
omf_web-1.0.0 lib/omf-web/widget/mustache_widget.rb
omf_web-0.9.9 lib/omf-web/widget/mustache_widget.rb
omf_web-0.9.8 lib/omf-web/widget/mustache_widget.rb
omf_web-0.9.7 lib/omf-web/widget/mustache_widget.rb