Updated ADBanner with fixes on index page, ADImage with fixes
Conflicts: app/views/admin/ad_banners/index.html.erb app/views/admin/ad_images/_form.html.erb vendor/built_in_modules/ad_banner/init.rb
This commit is contained in:
1 parent
a5c800d3fe
commit
a2e9aa2e0b
14 files changed
+414
-157
No files matched your search
@@ -1,10 +1,10 @@
|
||||
class Admin::AdBannersController < OrbitBackendController
|
||||
|
||||
before_filter :force_order_for_visitor,:only=>[:index]
|
||||
before_filter :force_order_for_user,:except => [:index]
|
||||
before_filter :for_app_sub_manager,:except => [:index]
|
||||
before_filter :force_order_for_visitor,:only=>[:index, :show]
|
||||
before_filter :force_order_for_user,:except => [:index, :show]
|
||||
before_filter :for_app_sub_manager,:except => [:index, :show]
|
||||
before_filter :for_app_manager,:except => [:index,:show,:update,:realtime_preview]
|
||||
|
||||
|
||||
|
||||
def rename
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
@@ -24,17 +24,18 @@ class Admin::AdBannersController < OrbitBackendController
|
||||
end
|
||||
|
||||
def new
|
||||
@ad_banners = AdBanner.all
|
||||
render :action => 'index',:params => 'new'
|
||||
@ad_banner = AdBanner.new
|
||||
render layout: false
|
||||
end
|
||||
|
||||
def create
|
||||
@ad_banner = AdBanner.new(params[:ad_banner])
|
||||
if @ad_banner.save
|
||||
@active = @ad_banner
|
||||
respond_to do |format|
|
||||
format.js {render 'new_created_node'}
|
||||
end
|
||||
redirect_to admin_ad_banners_url
|
||||
#respond_to do |format|
|
||||
# format.js {render 'new_created_node'}
|
||||
#end
|
||||
else
|
||||
render 'create_error_msg'
|
||||
end
|
||||
@@ -42,7 +43,6 @@ class Admin::AdBannersController < OrbitBackendController
|
||||
|
||||
def edit
|
||||
@ad_banner = AdBanner.find(params[:id])
|
||||
|
||||
end
|
||||
|
||||
def update
|
||||
|
||||
@@ -9,9 +9,15 @@ class Admin::AdImagesController < Admin::AdBannersController
|
||||
@app_title = "ad_banner"
|
||||
end
|
||||
|
||||
def index
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_images = @ad_banner.ad_images.all.page(params[:page]).per(10)
|
||||
end
|
||||
|
||||
def edit
|
||||
@ad_banner = AdBanner.find params[:ad_banner_id]
|
||||
@ad_image = @ad_banner.ad_images.find params[:id]
|
||||
@tags = get_tags
|
||||
end
|
||||
|
||||
def update
|
||||
@@ -28,6 +34,7 @@ class Admin::AdImagesController < Admin::AdBannersController
|
||||
@ad_image =ad_banner.ad_images.build
|
||||
@ad_image.post_date = Date.today
|
||||
@ad_image.unpost_date = Date.today + 30
|
||||
@tags = get_tags
|
||||
#render :action => 'new',:url=> {:ad_banner_id => params.has_key?(:ad_banner_id)? params[:ad_banner_id],nil}
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user