2014-05-19 21:21:06 +05:30
|
|
|
class ConferenceController < ApplicationController
|
2014-11-14 17:24:24 +01:00
|
|
|
before_filter :respond_to_options
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource find_by: :short_title
|
|
|
|
|
|
2014-11-14 17:24:24 +01:00
|
|
|
def index
|
|
|
|
|
@current = Conference.where('end_date >= ?', Date.current).order('start_date ASC')
|
|
|
|
|
@antiquated = @conferences - @current
|
|
|
|
|
end
|
|
|
|
|
|
2014-12-08 18:08:21 +02:00
|
|
|
def show; end
|
2014-06-30 19:24:26 +05:30
|
|
|
|
2014-11-27 14:31:44 +01:00
|
|
|
def schedule
|
|
|
|
|
@rooms = @conference.rooms
|
|
|
|
|
@events = @conference.events
|
|
|
|
|
@dates = @conference.start_date..@conference.end_date
|
|
|
|
|
|
|
|
|
|
if @dates == Date.current
|
|
|
|
|
@today = Date.current.strftime('%Y-%m-%d')
|
|
|
|
|
else
|
|
|
|
|
@today = @conference.start_date.strftime('%Y-%m-%d')
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-07-02 00:25:09 +05:30
|
|
|
def gallery_photos
|
2014-08-12 11:51:59 +03:00
|
|
|
@photos = @conference.photos
|
2014-08-18 21:54:43 +03:00
|
|
|
render 'photos', formats: [:js]
|
2014-06-30 19:24:26 +05:30
|
|
|
end
|
2014-11-14 17:24:24 +01:00
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
|
|
def respond_to_options
|
|
|
|
|
respond_to do |format|
|
|
|
|
|
format.html { head :ok }
|
|
|
|
|
end if request.options?
|
|
|
|
|
end
|
2014-05-19 21:21:06 +05:30
|
|
|
end
|