Class: Tramway::SportSchool::Web::WelcomeController

Inherits:
ApplicationController show all
Defined in:
app/controllers/tramway/sport_school/web/welcome_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#application

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/tramway/sport_school/web/welcome_controller.rb', line 6

def index
  @kind_sports = ::Tramway::SportSchool::KindSport.active.published.map { |k| ::Tramway::SportSchool::Features::KindSportDecorator.new k }
  @documents = ::Tramway::SportSchool::Document.active.published
  @trainers = ::Tramway::SportSchool::Trainer.active.published.map { |t| ::Tramway::SportSchool::Cards::TrainerDecorator.new t }
  @institution = ::Tramway::SportSchool::Institution.includes(:social_networks).first
  blocks = ::Tramway::Landing::Block.on_main_page
  @links = ::Tramway::Landing::BlockLinkDecorator.decorate blocks.with_navbar_link
  @blocks = ::Tramway::Landing::BlockDecorator.decorate blocks
  @organizations = ::Tramway::SportSchool::Organization.published
  @news = ::Tramway::News::News.active.last(3).reverse.map { |t| ::Tramway::Landing::Cards::NewsDecorator.new t }
  @education_documents = ::Tramway::SportSchool::Document.published.education.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
  @school_info_documents = ::Tramway::SportSchool::Document.published.school_info.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
  @provision_documents = ::Tramway::SportSchool::Document.published.provision.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
  @headers_documents = ::Tramway::SportSchool::Document.published.headers.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
  @finance_documents = ::Tramway::SportSchool::Document.published.finance.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
  @materially_documents = ::Tramway::SportSchool::Document.published.materially.map { |t| ::Tramway::SportSchool::Cards::DocumentDecorator.new t }
end