Sha256: 3dff66a92a0815399559b1a95b7cacce123d4419e3b105363dbff8fb831c6273

Contents?: true

Size: 596 Bytes

Versions: 67

Compression:

Stored size: 596 Bytes

Contents

class NavigationItemDecorator < ApplicationDecorator
  delegate_all

  def label
    result = ''
    result = object.translation.label if object.translation.label
    result = object.page.translation.title if object.page && result.blank?
    result
  end

  def path(options = {})
    result = '/'

    if object.translation.path.present?
      result = object.translation.path

    elsif object.page.present?
      result = object.page.decorate.path(options)
    end

    result
  end

  def options_for_page
    Page.order(:description).map do |p|
      [p.description, p.id]
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
udongo-7.2.0 app/decorators/navigation_item_decorator.rb
udongo-7.1.3 app/decorators/navigation_item_decorator.rb
udongo-7.1.2 app/decorators/navigation_item_decorator.rb
udongo-7.1.1 app/decorators/navigation_item_decorator.rb
udongo-7.1.0 app/decorators/navigation_item_decorator.rb
udongo-7.0.4 app/decorators/navigation_item_decorator.rb
udongo-7.0.3 app/decorators/navigation_item_decorator.rb
udongo-7.0.2 app/decorators/navigation_item_decorator.rb
udongo-7.0.1 app/decorators/navigation_item_decorator.rb
udongo-7.0.0 app/decorators/navigation_item_decorator.rb
udongo-6.6.3 app/decorators/navigation_item_decorator.rb
udongo-6.6.2 app/decorators/navigation_item_decorator.rb
udongo-6.6.1 app/decorators/navigation_item_decorator.rb
udongo-6.6.0 app/decorators/navigation_item_decorator.rb
udongo-6.5.2 app/decorators/navigation_item_decorator.rb
udongo-6.5.1 app/decorators/navigation_item_decorator.rb
udongo-6.5.0 app/decorators/navigation_item_decorator.rb
udongo-6.4.1 app/decorators/navigation_item_decorator.rb
udongo-6.4.0 app/decorators/navigation_item_decorator.rb
udongo-6.3.2 app/decorators/navigation_item_decorator.rb