2013-01-07 09:04:09 +01:00
|
|
|
class Admin::CallforpapersController < ApplicationController
|
|
|
|
|
before_filter :verify_organizer
|
|
|
|
|
|
2014-04-28 20:52:02 +02:00
|
|
|
def index
|
2013-01-07 09:04:09 +01:00
|
|
|
@cfp = @conference.call_for_papers
|
|
|
|
|
if @cfp.nil?
|
|
|
|
|
@cfp = CallForPapers.new
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def update
|
|
|
|
|
@cfp = @conference.call_for_papers
|
|
|
|
|
@cfp.update_attributes(params[:call_for_papers])
|
2014-04-28 21:42:09 +02:00
|
|
|
redirect_to(admin_conference_callforpapers_path(
|
|
|
|
|
id: @conference.short_title),
|
|
|
|
|
notice: 'Call for Papers was successfully updated.')
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def create
|
2014-04-28 21:42:09 +02:00
|
|
|
@cfp = CallForPapers.new(params[:call_for_papers])
|
2013-01-07 09:04:09 +01:00
|
|
|
@conference.call_for_papers = @cfp
|
|
|
|
|
if @cfp.save
|
2014-04-28 21:42:09 +02:00
|
|
|
redirect_to(admin_conference_callforpapers_path(
|
|
|
|
|
id: @conference.short_title),
|
|
|
|
|
notice: 'Call for Papers was successfully updated.')
|
2013-01-07 09:04:09 +01:00
|
|
|
else
|
2014-04-28 21:42:09 +02:00
|
|
|
redirect_to(admin_conference_callforpapers_path(
|
|
|
|
|
id: @conference.short_title),
|
|
|
|
|
error: 'Call for Papers failed.')
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|