Sha256: bb0ad99ea6b91f4a6c3fde2ab5cf06e832500b36baf3306c190c309795792243

Contents?: true

Size: 1.37 KB

Versions: 66

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

class Tramway::Event::EventsController < Tramway::Event::ApplicationController
  layout 'tramway/landing/application'

  def show
    event = ::Tramway::Event::Event.find params[:id]
    @event = ::Tramway::Event::Events::Show::EventDecorator.decorate event
    @participant_form = ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(request.uuid, @event).new ::Tramway::Event::Participant.new
    @sections_as_features = @event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
    @sections = @event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
    @footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
    @events = ::Tramway::Event::Event.active.actual.map { |e| ::Tramway::Event::Events::Show::EventDecorator.decorate e }
    @people_as_features = @event.partakings.active.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
    if defined?(::Tramway::Partner)
      @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
        hash.merge! partnership_type => (event.send(partnership_type.to_s.pluralize).active.map do |partner|
          Tramway::Partner::OrganizationFeatureDecorator.decorate partner
        end)
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
tramway-event-1.9.28.3 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.28.2 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.28.1 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.28 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.6 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.5 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.4 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.3 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.2 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27.1 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.27 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.26 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.25.1 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.25 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.24.1 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.24 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.23.2 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.23.1 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.23 app/controllers/tramway/event/events_controller.rb
tramway-event-1.9.22 app/controllers/tramway/event/events_controller.rb