Sha256: 37550b0359b49a870154a1acf1beae197fa5e5a403b2869e5ae8040565f51693

Contents?: true

Size: 672 Bytes

Versions: 11

Compression:

Stored size: 672 Bytes

Contents

module Locomotive
  class EditableElementPresenter < BasePresenter

    delegate :slug, :block, :default_content, :default_attribute, :hint, :priority, :disabled, :assignable, :from_parent, :to => :source

    def label
      self.slug.humanize
    end

    def type
      self.source._type.to_s.demodulize
    end

    def block_name
      if self.source.block
        self.source.block.gsub('\'', '').humanize
      else
        I18n.t('locomotive.pages.form.default_block')
      end
    end

    def included_methods
      super + %w(type label slug block_name block default_content default_attribute hint priority disabled assignable from_parent)
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
locomotive_cms-2.0.0.rc12 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc11 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc10 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc9 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc8 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc7 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc6 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc5 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc4 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc2 app/presenters/locomotive/editable_element_presenter.rb
locomotive_cms-2.0.0.rc1 app/presenters/locomotive/editable_element_presenter.rb