From a7601ecd609435a2357c889d7327009e32c74e2e Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Wed, 21 Oct 2015 23:20:04 +0300 Subject: [PATCH] Add volunteer teams listing --- app/controllers/public/volunteer_teams_controller.rb | 7 +++++++ config/routes.rb | 5 +---- .../views/public/volunteer_teams/_volunteer_team.slim | 6 ++++++ lib/initfest/views/public/volunteer_teams/index.slim | 6 ++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 app/controllers/public/volunteer_teams_controller.rb create mode 100644 lib/initfest/views/public/volunteer_teams/_volunteer_team.slim create mode 100644 lib/initfest/views/public/volunteer_teams/index.slim diff --git a/app/controllers/public/volunteer_teams_controller.rb b/app/controllers/public/volunteer_teams_controller.rb new file mode 100644 index 0000000..62dd648 --- /dev/null +++ b/app/controllers/public/volunteer_teams_controller.rb @@ -0,0 +1,7 @@ +module Public + class VolunteerTeamsController < Public::ApplicationController + def index + @volunteer_teams = current_conference.volunteer_teams + end + end +end diff --git a/config/routes.rb b/config/routes.rb index 2464b72..0d9b598 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,10 +10,7 @@ Rails.application.routes.draw do end end resources :volunteers - resources :volunteerships, only: [:index, :destroy] - resources :volunteer_teams, only: [] do - resource :volunteership, only: :create - end + resources :volunteer_teams, only: [:index] end namespace :api do diff --git a/lib/initfest/views/public/volunteer_teams/_volunteer_team.slim b/lib/initfest/views/public/volunteer_teams/_volunteer_team.slim new file mode 100644 index 0000000..e3c9dfb --- /dev/null +++ b/lib/initfest/views/public/volunteer_teams/_volunteer_team.slim @@ -0,0 +1,6 @@ +- if volunteer_team_counter % 3 == 0 + .clearfix.visible-lg-block +.col-lg-3 + h2 = volunteer_team.name + .description + = simple_format volunteer_team.description diff --git a/lib/initfest/views/public/volunteer_teams/index.slim b/lib/initfest/views/public/volunteer_teams/index.slim new file mode 100644 index 0000000..957d8c2 --- /dev/null +++ b/lib/initfest/views/public/volunteer_teams/index.slim @@ -0,0 +1,6 @@ +- content_for(:title) { VolunteerTeam.model_name.human(count: 2).mb_chars.capitalize.to_s } + +h1 = VolunteerTeam.model_name.human(count: 2).mb_chars.capitalize + +.container.volunteer_teams + = render partial: 'volunteer_team', collection: @volunteer_teams