Sha256: 8eb53065d5f6c8deec437d5f86b9beccf1e3a8699edf51ac0d820fbeb8f440cf

Contents?: true

Size: 1.29 KB

Versions: 1

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require_dependency 'tramway/conference/application_controller'

class Tramway::Conference::Web::WelcomeController < ::Tramway::Conference::ApplicationController
  def index
    @unity = ::Tramway::Conference::Unity.includes(:social_networks).first
    @blocks = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.on_main_page
    @news = ::Tramway::News::News.first(3).map { |t| ::Tramway::Landing::Cards::NewsDecorator.new t }
    past_events = ::Tramway::Event::EventLinkDecorator.decorate ::Tramway::Event::Event.past.open.order begin_date: :desc
    past_events_links = Tramway::Landing::NavbarDecorator.new [{ past_events: past_events }]
    actual_events = ::Tramway::Event::EventLinkDecorator.decorate ::Tramway::Event::Event.actual.open.order :begin_date
    @links = actual_events + past_events_links
    @close_events = ::Tramway::Event::Event.actual.open.map do |event|
      ::Tramway::Event::EventAsPageWithButtonDecorator.decorate event
    end
    @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
      hash.merge! partnership_type => (@unity.send(partnership_type.to_s.pluralize).map do |partner|
        Tramway::Partner::OrganizationFeatureDecorator.decorate partner
      end)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tramway-conference-1.9.5.4 app/controllers/tramway/conference/web/welcome_controller.rb