2014-08-06 21:14:00 +03:00
|
|
|
module Admin
|
2014-08-13 14:37:05 +03:00
|
|
|
class VenueController < Admin::BaseController
|
2014-08-12 11:51:59 +03:00
|
|
|
load_and_authorize_resource :conference, find_by: :short_title
|
|
|
|
|
load_and_authorize_resource :venue, through: :conference, singleton: true
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2014-08-12 22:27:02 +03:00
|
|
|
def index; end
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def update
|
|
|
|
|
@venue = @conference.venue
|
|
|
|
|
@venue.assign_attributes(params[:venue])
|
2014-08-12 16:04:24 +05:30
|
|
|
send_mail = @venue.venue_notify?(@conference)
|
2014-08-06 21:14:00 +03:00
|
|
|
if @venue.update_attributes(params[:venue])
|
2014-08-12 16:04:24 +05:30
|
|
|
Mailbot.delay.send_email_on_venue_update(@conference) if send_mail
|
2014-08-06 21:14:00 +03:00
|
|
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
|
|
|
|
notice: 'Venue was successfully updated.')
|
|
|
|
|
else
|
|
|
|
|
redirect_to(admin_conference_venue_info_path(conference_id: @conference.short_title),
|
|
|
|
|
notice: 'Venue Updation Failed!')
|
|
|
|
|
end
|
2014-06-13 22:50:46 +05:30
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
|
2014-08-06 21:14:00 +03:00
|
|
|
def show
|
|
|
|
|
@venue = @conference.venue
|
|
|
|
|
render :venue_info
|
|
|
|
|
end
|
2013-01-07 09:04:09 +01:00
|
|
|
end
|
|
|
|
|
end
|