diff --git a/app/controllers/admin/schedule_controller.rb b/app/controllers/admin/schedules_controller.rb similarity index 68% rename from app/controllers/admin/schedule_controller.rb rename to app/controllers/admin/schedules_controller.rb index d35f0b15..1c9dd453 100644 --- a/app/controllers/admin/schedule_controller.rb +++ b/app/controllers/admin/schedules_controller.rb @@ -1,6 +1,6 @@ -class Admin::ScheduleController < ApplicationController +class Admin::SchedulesController < ApplicationController before_filter :verify_organizer - skip_before_filter :verify_authenticity_token, :only => [:update] + skip_before_filter :verify_authenticity_token, only: [:update] layout "schedule" def show @@ -13,26 +13,26 @@ class Admin::ScheduleController < ApplicationController end def update - event = Event.where(:guid => params[:event]).first + event = Event.where(guid: params[:event]).first error_message = nil if event.nil? error_message = "Could not find event GUID: #{params[:event]}" end - if params[:date] == "none" + if params[:date] == 'none' event.start_time = nil event.room = nil event.save! - render :json => {"status" => "ok"} + render json: {'status' => 'ok'} return end - room = Room.where(:guid => params[:room]).first + room = Room.where(guid: params[:room]).first if room.nil? error_message = "Could not find room GUID: #{params[:room]}" end if !error_message.nil? - render :json => {"status" => "error", "message" => error_message}, :status => 500 + render json: {'status' => 'error', 'message' => error_message}, status: 500 return end @@ -44,10 +44,10 @@ class Admin::ScheduleController < ApplicationController # only on output # zone = ActiveSupport::TimeZone::new(@conference.timezone) # startTime = DateTime.strptime(time + zone.formatted_offset, "%Y-%m-%d %k:%M %Z") - startTime = DateTime.strptime(time, "%Y-%m-%d %k:%M") + startTime = DateTime.strptime(time, '%Y-%m-%d %k:%M') event.start_time = startTime event.save! - render :json => {"status" => "ok"} + render json: {'status' => 'ok'} end diff --git a/app/views/admin/schedule/_day_tab.html.haml b/app/views/admin/schedules/_day_tab.html.haml similarity index 100% rename from app/views/admin/schedule/_day_tab.html.haml rename to app/views/admin/schedules/_day_tab.html.haml diff --git a/app/views/admin/schedule/show.html.haml b/app/views/admin/schedules/show.html.haml similarity index 95% rename from app/views/admin/schedule/show.html.haml rename to app/views/admin/schedules/show.html.haml index a1bb6f7d..eda7348b 100644 --- a/app/views/admin/schedule/show.html.haml +++ b/app/views/admin/schedules/show.html.haml @@ -9,7 +9,7 @@ %ul#date-tabs - @dates.each do |date| %li.date-selector - = link_to "#{date}", "#", :id => "#{date}-selector", :onclick => "Schedule.changeDay('#{date}')" + = link_to "#{date}", "#", id: "#{date}-selector", onclick: "Schedule.changeDay('#{date}')" .schedule-rooms-container = render 'day_tab' diff --git a/config/routes.rb b/config/routes.rb index 887e5a61..ae46877b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,22 +2,21 @@ Osem::Application.routes.draw do get 'conference/show' - devise_for :users, :controllers => { :registrations => :registrations }, :path => 'accounts' + devise_for :users, controllers: { registrations: :registrations }, path: 'accounts' namespace :admin do resources :users resources :people resources :conference do - get "/schedule" => "schedule#show" - patch "/schedule" => "schedule#update" - get "/stats" => "stats#index" - get "/venue" => "venue#show", :as => "venue_info" - patch "/venue" => "venue#update", :as => "venue_update" - get "/dietary_choices" => "dietchoices#show", :as => "dietary_list" - patch "/dietary_choices" => "dietchoices#update", :as => "dietary_update" - get "/volunteers_list" => "volunteers#show" - get "/volunteers" => "volunteers#index", :as => "volunteers_info" - patch "/volunteers" => "volunteers#update", :as => "volunteers_update" + resource :schedule, only: [:show, :update] + get '/stats' => 'stats#index' + get '/venue' => 'venue#show', as: 'venue_info' + patch '/venue' => 'venue#update', as: 'venue_update' + get '/dietary_choices' => 'dietchoices#show', as: 'dietary_list' + patch '/dietary_choices' => 'dietchoices#update', as: 'dietary_update' + get '/volunteers_list' => 'volunteers#show' + get '/volunteers' => 'volunteers#index', as: 'volunteers_info' + patch '/volunteers' => 'volunteers#update', as: 'volunteers_update' patch '/registrations/change_field' => 'registrations#change_field' resources :registrations