- Restructuring the assets

- Worked on the schedule
- Removed some gems
This commit is contained in:
Matt Barringer 2013-01-11 15:00:54 +01:00
parent a9207671b8
commit b801f0dc19
123 changed files with 13587 additions and 33123 deletions

View file

@ -3,11 +3,48 @@ class Admin::ScheduleController < ApplicationController
layout "schedule"
def show
if @conference.nil?
redirect_to admin_conference_index_path
return
end
@dates = @conference.start_date..@conference.end_date
@tracks = @conference.tracks
@rooms = @conference.rooms
end
def update
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"
event.start_time = nil
event.room = nil
event.save!
render :json => {"status" => "ok"}
return
end
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
return
end
event.room = room
time = "#{params[:date]} #{params[:time]}"
Rails.logger.debug("Loading #{time}")
zone = ActiveSupport::TimeZone::new(@conference.timezone)
startTime = DateTime.strptime(time + zone.formatted_offset, "%Y-%m-%d %k:%M %Z")
event.start_time = startTime
event.save!
render :json => {"status" => "ok"}
end
end
end