osem-fcy/app/controllers/conference_controller.rb

35 lines
1,002 B
Ruby
Raw Normal View History

class ConferenceController < ApplicationController
protect_from_forgery with: :null_session
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
load_resource :program, through: :conference, singleton: true, except: :index
2014-08-12 11:51:59 +03:00
2014-11-14 17:24:24 +01:00
def index
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
2014-11-14 17:24:24 +01:00
@antiquated = @conferences - @current
end
def show; end
2014-06-30 19:24:26 +05:30
2014-11-27 14:31:44 +01:00
def schedule
2015-11-07 11:43:36 +02:00
@rooms = @conference.venue.rooms if @conference.venue
@events = @conference.program.events
2016-06-22 16:09:17 +03:00
@events_xml = @events.scheduled.order(start_time: :asc).group_by{ |event| event.start_time.to_date }
2014-11-27 14:31:44 +01:00
@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-11-14 17:24:24 +01:00
private
2015-10-28 18:05:15 +02:00
def respond_to_options
respond_to do |format|
format.html { head :ok }
end if request.options?
end
end