This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/controllers/admin/ad_banners_controller.rb

63 lines
1.5 KiB
Ruby
Raw Normal View History

class Admin::AdBannersController < OrbitBackendController
layout "new_admin"
2012-01-31 10:31:31 +00:00
before_filter :authenticate_user!
2012-05-15 08:39:23 +00:00
before_filter :for_app_manager,:except => [:index,:show]
before_filter :for_app_sub_manager
2012-01-31 10:31:31 +00:00
def rename
@ad_banner = AdBanner.find(params[:id])
@ad_banner.title = params[:body]
render :json => {:success =>@ad_banner.save!}
end
2012-01-31 10:31:31 +00:00
def destroy
@ad_banner = AdBanner.find(params[:id])
@ad_banner.destroy
redirect_to admin_ad_banners_url
end
def show
2012-04-01 15:39:49 +00:00
@ad_banners = AdBanner.all
@active = AdBanner.find(params[:id])
render :action => 'index'
2012-01-31 10:31:31 +00:00
end
def new
2012-04-01 15:39:49 +00:00
@ad_banners = AdBanner.all
render :action => 'index',:params => 'new'
2012-01-31 10:31:31 +00:00
end
def create
@ad_banner = AdBanner.new(params[:ad_banner])
2012-04-18 07:26:59 +00:00
if @ad_banner.save
@active = @ad_banner
respond_to do |format|
format.js {render 'new_created_node'}
end
else
render 'create_error_msg'
end
2012-01-31 10:31:31 +00:00
end
def edit
@ad_banner = AdBanner.find(params[:id])
end
def update
@ad_banner = AdBanner.find(params[:id])
@ad_banner.update_attributes(params[:ad_banner])
@ad_banner.save
redirect_to admin_ad_banners_url
end
2012-04-13 09:24:30 +00:00
def realtime_preview
@ad_banner = AdBanner.find( params[:id] ).preview_clone
@ad_banner.update_attributes(params[:ad_banner])#.update_attributes(params[:ad_images])
2012-04-01 15:39:49 +00:00
end
2012-01-31 10:31:31 +00:00
def index
@ad_banners = AdBanner.all
2012-04-17 07:21:43 +00:00
@active = @ad_banners.first
2012-01-31 10:31:31 +00:00
end
end