Sha256: 6751fe497da78a9460d4c72c0bc804a5ec8d69826fd9deebb5eaa30796ebf609

Contents?: true

Size: 670 Bytes

Versions: 24

Compression:

Stored size: 670 Bytes

Contents

class Tramway::Landing::BlockDecorator < ::Tramway::Core::ApplicationDecorator
  class << self
    def collections
      [ :all ]
    end

    def list_attributes
      [ :position, :view_state, :block_type ]
    end
  end

  delegate :position, to: :object
  delegate :title, to: :object
  delegate :background, to: :object
  delegate :anchor, to: :object
  delegate :description, to: :object
  delegate :anchor, to: :object

  def block_type
    object.block_type_text
  end

  def view_state
    object.human_view_state_name
  end

  def view_state_button_color(event)
    case event
    when :publish
      :primary
    when :hide
      :secondary
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tramway-landing-1.4.7.1 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.7 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.6 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.5 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.4 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.3 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.2 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4.1 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.4 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.6 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.5 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.4 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.3 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.2 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3.1 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.3 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.20 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.19 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.18 app/decorators/tramway/landing/block_decorator.rb
tramway-landing-1.2.17 app/decorators/tramway/landing/block_decorator.rb