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.9.0 app/decorators/navigation_item_decorator.rb
udongo-7.8.1 app/decorators/navigation_item_decorator.rb
udongo-7.8.0 app/decorators/navigation_item_decorator.rb
udongo-7.7.2 app/decorators/navigation_item_decorator.rb
udongo-7.7.1 app/decorators/navigation_item_decorator.rb
udongo-7.7.0 app/decorators/navigation_item_decorator.rb
udongo-7.6.2 app/decorators/navigation_item_decorator.rb
udongo-7.6.1 app/decorators/navigation_item_decorator.rb
udongo-7.6.0 app/decorators/navigation_item_decorator.rb
udongo-7.5.1 app/decorators/navigation_item_decorator.rb
udongo-7.5.0 app/decorators/navigation_item_decorator.rb
udongo-7.4.2 app/decorators/navigation_item_decorator.rb
udongo-7.4.1 app/decorators/navigation_item_decorator.rb
udongo-7.4.0 app/decorators/navigation_item_decorator.rb
udongo-7.3.5 app/decorators/navigation_item_decorator.rb
udongo-7.3.4 app/decorators/navigation_item_decorator.rb
udongo-7.3.3 app/decorators/navigation_item_decorator.rb
udongo-7.3.2 app/decorators/navigation_item_decorator.rb
udongo-7.3.1 app/decorators/navigation_item_decorator.rb
udongo-7.2.1 app/decorators/navigation_item_decorator.rb