Track related fixes

Make the message in admin/Tracks form more visible by making it bold and
adding links to venue and rooms
Make papertrail track changes for all the track's attributes
Add validation to require presence of description for self-organized
tracks
Add ID column to admin/Tracks#index
Make the cfp inclusion column sortable
Show success/error flash messages after toggling cfp inclusion
This commit is contained in:
AEtherC0r3 2017-08-08 12:41:37 +03:00 committed by Stella Rouzi
parent 5f1ed7ce85
commit b717018b31
9 changed files with 114 additions and 32 deletions

View file

@ -4,6 +4,9 @@ module Admin
load_and_authorize_resource :program, through: :conference, singleton: true
load_and_authorize_resource through: :program, find_by: :short_name
# Show flash message with ajax calls
after_action :prepare_unobtrusive_flash, only: :toggle_cfp_inclusion
def index; end
def show
@ -55,9 +58,13 @@ module Admin
def toggle_cfp_inclusion
@track.cfp_active = !@track.cfp_active
if @track.save
head :ok
flash[:notice] = "Successfully changed cfp inclusion of #{@track.name} to #{@track.cfp_active}"
else
head :unprocessable_entity
flash[:error] = "Failed to toggle cfp inclusion of #{@track.name} to #{@track.cfp_active}"
end
respond_to do |format|
format.js
end
end