From f7737f0e8e96198560abc07b52ab980d9c0fb0ca Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Sat, 15 Aug 2015 06:00:07 +0300 Subject: [PATCH] Introduce Public::HomeController --- app/controllers/public/home_controller.rb | 6 ++++++ config/routes.rb | 2 +- lib/initfest/views/public/home/_event_type.slim | 1 + lib/initfest/views/public/home/_track.slim | 6 ++++++ lib/initfest/views/public/home/index.slim | 14 ++++++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 app/controllers/public/home_controller.rb create mode 100644 lib/initfest/views/public/home/_event_type.slim create mode 100644 lib/initfest/views/public/home/_track.slim create mode 100644 lib/initfest/views/public/home/index.slim diff --git a/app/controllers/public/home_controller.rb b/app/controllers/public/home_controller.rb new file mode 100644 index 0000000..8514a6a --- /dev/null +++ b/app/controllers/public/home_controller.rb @@ -0,0 +1,6 @@ +module Public + class HomeController < Public::ApplicationController + def index + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 3d84392..e98b747 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,7 +2,7 @@ Rails.application.routes.draw do devise_for :users scope module: :public, constraints: {subdomain: 'cfp'}, conference_id: 1 do - root to: 'events#index' + root to: 'home#index' resource :personal_profile, path: 'profile' resources :events end diff --git a/lib/initfest/views/public/home/_event_type.slim b/lib/initfest/views/public/home/_event_type.slim new file mode 100644 index 0000000..8c51604 --- /dev/null +++ b/lib/initfest/views/public/home/_event_type.slim @@ -0,0 +1 @@ +=> link_to t('views.welcome.submit_event', event_type: event_type.name.mb_chars.downcase), new_event_path(type: event_type.id), class: 'btn-link btn-link-large' diff --git a/lib/initfest/views/public/home/_track.slim b/lib/initfest/views/public/home/_track.slim new file mode 100644 index 0000000..1818ca1 --- /dev/null +++ b/lib/initfest/views/public/home/_track.slim @@ -0,0 +1,6 @@ +li + p + strong + = track.name + span<> – + = track.description diff --git a/lib/initfest/views/public/home/index.slim b/lib/initfest/views/public/home/index.slim new file mode 100644 index 0000000..a3222a3 --- /dev/null +++ b/lib/initfest/views/public/home/index.slim @@ -0,0 +1,14 @@ +h1.entry-title = t :home_title, conference: current_conference.title + += simple_format current_conference.description + +p = t :what_we_ask + +ul + = render partial: 'track', collection: current_conference.tracks + +p = t :license_notice + +- if current_conference.call_for_participation.in_progress? + .centered.large + = render partial: 'event_type', collection: current_conference.event_types