Sha256: 07ad41b955a9d66765771c9ef77fbff7ffd6a5944eb08d135503898cbb872ec0

Contents?: true

Size: 729 Bytes

Versions: 4

Compression:

Stored size: 729 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::SectionDecorator < ::Tramway::Landing::BlockTypes::FeaturesDecorator
  class << self
    def collections
      [:all]
    end

    def show_associations
      [ :partakings ]
    end
  end

  delegate :description, to: :object
  decorate_association :event
  decorate_association :partakings, as: :part, decorator: Tramway::Event::PartakingFeatureDecorator

  def name
    "#{object.title} | #{object.event.title}"
  end

  def title
    "#{fa_icon(object.icon)} #{object.title}".html_safe
  end

  def background
    object.photo
  end

  def anchor
    "section-#{object.id}"
  end

  def event_title
    event.title
  end

  def event_duration
    event.duration
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tramway-event-1.12.6.4 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.6.3 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.6.2 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.6 app/decorators/tramway/event/section_decorator.rb