Sha256: 84b65906332e0cd084b40745bdcaf0c0043520dec3a7383d8240f575dc9a82c4

Contents?: true

Size: 660 Bytes

Versions: 11

Compression:

Stored size: 660 Bytes

Contents

module Pageflow
  class BuiltInWidgetType < WidgetType
    attr_reader :name, :roles, :partial_path

    def initialize(name, roles, partial_path)
      @name = name
      @roles = roles
      @partial_path = partial_path
    end

    def translation_key
      "pageflow.widgets.type_names.#{name}"
    end

    def render(template, entry)
      template.render(partial_path, entry: entry)
    end

    def self.navigation
      new('default_navigation', ['navigation'], 'pageflow/entries/navigation')
    end

    def self.mobile_navigation
      new('default_mobile_navigation', ['mobile_navigation'], 'pageflow/entries/mobile_navigation')
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pageflow-0.10.0 lib/pageflow/built_in_widget_type.rb
pageflow-0.9.2 lib/pageflow/built_in_widget_type.rb
pageflow-0.9.1 lib/pageflow/built_in_widget_type.rb
pageflow-0.9.0 lib/pageflow/built_in_widget_type.rb
pageflow-0.8.2 lib/pageflow/built_in_widget_type.rb
pageflow-0.8.1 lib/pageflow/built_in_widget_type.rb
pageflow-0.8.0 lib/pageflow/built_in_widget_type.rb
pageflow-0.7.2 lib/pageflow/built_in_widget_type.rb
pageflow-0.7.1 lib/pageflow/built_in_widget_type.rb
pageflow-0.7.0 lib/pageflow/built_in_widget_type.rb
pageflow-0.6.0 lib/pageflow/built_in_widget_type.rb