diff --git a/app/assets/javascripts/lib/jquery.pageslide.js b/app/assets/javascripts/lib/jquery.pageslide.js
index e9b049bb..2455bb51 100644
--- a/app/assets/javascripts/lib/jquery.pageslide.js
+++ b/app/assets/javascripts/lib/jquery.pageslide.js
@@ -242,7 +242,7 @@
bodyAnimateIn['margin-left'] = '-=' + slideWidth;
slideAnimateIn['left'] = '-=' + slideWidth;
if($pageslide.find('.preview').length) {
- $pageslide.find('.preview').cycle('destroy');
+ // $pageslide.find('.preview').cycle('destroy');
$pageslide.find('.preview img').removeAttr('style');
}
break;
diff --git a/app/controllers/admin/ad_banners_controller.rb b/app/controllers/admin/ad_banners_controller.rb
index cae3f19c..37ac3fac 100644
--- a/app/controllers/admin/ad_banners_controller.rb
+++ b/app/controllers/admin/ad_banners_controller.rb
@@ -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
diff --git a/app/controllers/admin/ad_images_controller.rb b/app/controllers/admin/ad_images_controller.rb
index fc25c5d5..78caf3aa 100644
--- a/app/controllers/admin/ad_images_controller.rb
+++ b/app/controllers/admin/ad_images_controller.rb
@@ -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
diff --git a/app/models/ad_banner.rb b/app/models/ad_banner.rb
index dcae4aea..b5b275dc 100644
--- a/app/models/ad_banner.rb
+++ b/app/models/ad_banner.rb
@@ -3,6 +3,7 @@ class AdBanner
include Mongoid::Timestamps
include Mongoid::MultiParameterAttributes
include OrbitCoreLib::ObjectAuthable
+ include OrbitTag::Taggable
field :title
field :transition_msec,type: Integer
diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb
index 4d5227c9..ac34a595 100644
--- a/app/models/ad_image.rb
+++ b/app/models/ad_image.rb
@@ -1,6 +1,7 @@
class AdImage
include Mongoid::Document
include Mongoid::Timestamps
+ include OrbitTag::Taggable
mount_uploader :file, ImageUploader
diff --git a/app/views/admin/ad_banners/_new.html.erb b/app/views/admin/ad_banners/_new.html.erb
new file mode 100644
index 00000000..e8d0ba13
--- /dev/null
+++ b/app/views/admin/ad_banners/_new.html.erb
@@ -0,0 +1,25 @@
+
+ <%= form_for(:ad_banner, :url => admin_ad_banners_path) do |f| %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/admin/ad_banners/edit.html.erb b/app/views/admin/ad_banners/edit.html.erb
new file mode 100644
index 00000000..a74ab0ab
--- /dev/null
+++ b/app/views/admin/ad_banners/edit.html.erb
@@ -0,0 +1,25 @@
+
+ <%= form_for(:ad_banner, :url => admin_ad_banners_path, :remote => true) do |f| %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb
index 9b2550d5..5a27d13f 100644
--- a/app/views/admin/ad_banners/index.html.erb
+++ b/app/views/admin/ad_banners/index.html.erb
@@ -1,34 +1,51 @@
-<% content_for :page_specific_css do -%>
- <%#= stylesheet_link_tag "admin/ad_banner_preview" %>
-<% end -%>
-<% content_for :page_specific_javascript do -%>
- <%= javascript_include_tag "/static/jquery.cycle.all.latest.js" %>
- <%= javascript_include_tag "inc/modal-preview" %>
- <%= javascript_include_tag "lib/contenteditable" %>
-
-<% end -%>
+<% set_default_index do
+objects @ad_banners
-
-
- <% @ad_banners.each do |ab| %>
- <%= content_tag :li ,:class => (ab == @active ? 'active' : nil) do %>
- <%if at_least_module_manager%>
-
- <%= link_to(ab.title,"##{ab.title.dehumanize}",:contenteditable=>"false",:data=>{:toggle=>"tab" ,'edit-url' =>(admin_rename_ad_banner_path ab) } )%>
- <% else %>
- <%= link_to(ab.title,"##{ab.title.dehumanize}",:data=>{:toggle=>"tab" } )%>
- <% end -%>
- <% end -%>
- <% end -%>
-
- <%= content_tag :li,link_to(t('new.banner'),"#new-a-banner",:data=>{:toggle=>"modal"}),:id=>'new_ad_banner_tab_but',:class => (@active.nil? ? 'active' : nil ) if at_least_module_manager%>
-
-