mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
Introduce Program to include cfp/rooms/tracks/events/event_types/difficulty_levels
This commit is contained in:
parent
028b82fda8
commit
444356fbc7
117 changed files with 1812 additions and 905 deletions
32
app/controllers/admin/programs_controller.rb
Normal file
32
app/controllers/admin/programs_controller.rb
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
module Admin
|
||||
class ProgramsController < Admin::BaseController
|
||||
load_and_authorize_resource :conference, find_by: :short_title
|
||||
load_and_authorize_resource through: :conference, singleton: true
|
||||
|
||||
def show; end
|
||||
|
||||
def edit; end
|
||||
|
||||
def update
|
||||
authorize! :update, @conference.program
|
||||
@program = @conference.program
|
||||
@program.assign_attributes(params[:program])
|
||||
# send_mail_on_schedule_public = @program.notify_on_schedule_public?
|
||||
|
||||
if @program.update_attributes(params[:program])
|
||||
# Mailbot.delay.send_on_schedule_public(@conference) if send_mail_on_schedule_public
|
||||
redirect_to(admin_conference_program_path(@conference.short_title),
|
||||
notice: 'The program was successfully updated.')
|
||||
else
|
||||
flash[:error] = "Updating program failed. #{@program.errors.to_a.join('. ')}."
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def program_params
|
||||
params[:program]
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue