Sha256: c1af6276aa30d620f26173573e5912a2907b29cf6ddade6981395fe1005ec2b8

Contents?: true

Size: 1.85 KB

Versions: 12

Compression:

Stored size: 1.85 KB

Contents

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.active.first(3).map { |t| ::Tramway::Landing::Cards::NewsDecorator.new t }
    past_events = ::Tramway::Event::EventLinkDecorator.decorate ::Tramway::Event::Event.active.past.order begin_date: :desc
    past_events_links = Tramway::Landing::NavbarDecorator.new [{ past_events: past_events }]
    actual_events = ::Tramway::Event::EventLinkDecorator.decorate ::Tramway::Event::Event.active.actual.order :begin_date
    @links = actual_events + past_events_links
    main_event = ::Tramway::Event::Event.main_event&.last
    if main_event.present?
      @main_event = ::Tramway::Event::Events::Show::EventDecorator.decorate main_event
      @sections_as_features = main_event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
      @sections = main_event.sections.active.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
      @participant_form = ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(request.uuid, main_event).new ::Tramway::Event::Participant.new
      @people_as_features = @main_event.partakings.active.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
    end
    @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
      hash.merge! partnership_type => (@unity.send(partnership_type.to_s.pluralize).active.map do |partner|
        Tramway::Partner::OrganizationFeatureDecorator.decorate partner
      end)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tramway-conference-1.8.13.1 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.13 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12.5 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12.4 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12.3 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12.2 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12.1 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.12 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.11 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.10 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8.9 app/controllers/tramway/conference/web/welcome_controller.rb
tramway-conference-1.8 app/controllers/tramway/conference/web/welcome_controller.rb