mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 06:01:12 +00:00
Schedule update moved to program update
Schedule update updated a program attribute
This commit is contained in:
parent
310c521790
commit
81108290e5
4 changed files with 41 additions and 22 deletions
|
|
@ -9,8 +9,6 @@ module Admin
|
|||
load_resource :selected_schedule, through: :program, singleton: true
|
||||
load_resource :venue, through: :conference, singleton: true
|
||||
|
||||
skip_before_action :verify_authenticity_token, only: [:update]
|
||||
|
||||
def index; end
|
||||
|
||||
def create
|
||||
|
|
@ -29,16 +27,6 @@ module Admin
|
|||
@rooms = (@venue && @venue.rooms.any?) ? @venue.rooms : [Room.new(name: 'No Rooms!', size: 0)]
|
||||
end
|
||||
|
||||
def update
|
||||
if params[:selected_schedule] == 'true'
|
||||
@program.selected_schedule_id = params[:id].to_i
|
||||
elsif params[:selected_schedule] == 'false' && (@selected_schedule.id == params[:id].to_i)
|
||||
@program.selected_schedule_id = nil
|
||||
end
|
||||
@program.save
|
||||
render json: { 'status' => 'ok' }
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @schedule.destroy
|
||||
redirect_to admin_conference_schedules_path(conference_id: @conference.short_title),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue