This commit is contained in:
Gopesh Tulsyan 2014-05-26 10:19:26 +00:00
commit 777e581f72
37 changed files with 554 additions and 13 deletions

View file

@ -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

View 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

View 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

View 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