Sponsor dashboard added, with sponsor component for splash page

This commit is contained in:
Gopesh Tulsyan 2014-05-26 13:51:03 +05:30
parent 643b8b173a
commit ea119a8158
36 changed files with 549 additions and 12 deletions

View file

@ -0,0 +1,43 @@
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,16 @@
class Admin::SponsorshipLevelsController < ApplicationController
before_filter :verify_organizer
def show
render :sponsorship_levels
end
def update
begin
@conference.update_attributes!(params[:conference])
redirect_to(admin_conference_sponsorship_levels_path(:conference_id => @conference.short_title), :notice => 'Sponsorship levels were successfully updated.')
rescue Exception => e
redirect_to(admin_conference_sponsorship_levels_path(:conference_id => @conference.short_title), :alert => "Sponsorship levels update failed: #{e.message}")
end
end
end

View file

@ -0,0 +1,17 @@
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