Merge 7cfa9ac5fb into a33e930111
This commit is contained in:
commit
777e581f72
37 changed files with 554 additions and 13 deletions
|
|
@ -35,7 +35,7 @@ class Admin::ConferenceController < ApplicationController
|
|||
else
|
||||
redirect_to(edit_admin_conference_path(id: short_title),
|
||||
alert: 'Updating conference failed. ' \
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
"#{@conference.errors.full_messages.join('. ')}.")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
44
app/controllers/admin/organizations_controller.rb
Normal file
44
app/controllers/admin/organizations_controller.rb
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
class Admin::OrganizationsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
respond_to :html
|
||||
|
||||
def index
|
||||
@organizations = Organization.all
|
||||
end
|
||||
|
||||
def new
|
||||
@organization = Organization.new
|
||||
end
|
||||
|
||||
def create
|
||||
@organization = Organization.new(params[:organization])
|
||||
flash[:notice] = 'Organization was successfully created.' if @organization.save
|
||||
respond_with @organization, location: admin_organizations_path
|
||||
end
|
||||
|
||||
def show
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def edit
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def update
|
||||
@organization = Organization.find(params[:id])
|
||||
flash[:notice] = 'Organization was successfully updated'
|
||||
if @organization.update_attributes(params[:organization])
|
||||
respond_with @organization, location: admin_organizations_path
|
||||
end
|
||||
|
||||
def delete
|
||||
@organization = Organization.find(params[:id])
|
||||
end
|
||||
|
||||
def destroy
|
||||
@organization = Organization.find(params[:id])
|
||||
@organization.destroy
|
||||
redirect_to admin_organizations_path, notice: 'Organization got deleted'
|
||||
|
||||
end
|
||||
end
|
||||
19
app/controllers/admin/sponsorship_levels_controller.rb
Normal file
19
app/controllers/admin/sponsorship_levels_controller.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class Admin::SponsorshipLevelsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
|
||||
def show
|
||||
render :sponsorship_levels
|
||||
end
|
||||
|
||||
def update
|
||||
if @conference.update_attributes!(params[:conference])
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
notice: 'Sponsorship levels were successfully updated.')
|
||||
else
|
||||
redirect_to(admin_conference_sponsorship_levels_path(
|
||||
conference_id: @conference.short_title),
|
||||
alert: 'Sponsorship levels update failed')
|
||||
end
|
||||
end
|
||||
end
|
||||
19
app/controllers/admin/sponsorships_controller.rb
Normal file
19
app/controllers/admin/sponsorships_controller.rb
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
class Admin::SponsorshipsController < ApplicationController
|
||||
before_filter :verify_organizer
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
params[:sponsorship_registration][:conference_id] = @conference.id
|
||||
sponsorship = SponsorshipRegistration.new(params[:sponsorship_registration])
|
||||
if sponsorship.save
|
||||
redirect_to(admin_conference_sponsorships_path(
|
||||
conference_id: @conference.short_title), notice: 'Sponsorship added')
|
||||
else
|
||||
redirect_to(admin_conference_sponsorships_path(conference_id: @conference.short_title),
|
||||
alert: 'Sponsorship creation failed.' \
|
||||
"#{sponsorship.errors.full_messages.join('. ')}")
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue