Sha256: ba24ef6c04395386db489171c9a730c2522d98ea9653d744333961f80767f08d

Contents?: true

Size: 748 Bytes

Versions: 7

Compression:

Stored size: 748 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_attributes :description, :created_at, :photo
  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

7 entries across 7 versions & 1 rubygems

Version Path
tramway-event-2.0.1 app/decorators/tramway/event/section_decorator.rb
tramway-event-2.0.0.1 app/decorators/tramway/event/section_decorator.rb
tramway-event-2.0 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.9.1 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.9 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.8.2 app/decorators/tramway/event/section_decorator.rb
tramway-event-1.12.8.1 app/decorators/tramway/event/section_decorator.rb