diff --git a/ad_banner.gemspec b/ad_banner.gemspec index ea883fc..66e00d8 100644 --- a/ad_banner.gemspec +++ b/ad_banner.gemspec @@ -2,6 +2,19 @@ $:.push File.expand_path("../lib", __FILE__) # Maintain your gem's version: require "ad_banner/version" +app_path = File.expand_path(__dir__) +template_path = ENV['PWD'] + '/app/templates' +all_template = Dir.glob(template_path+'/*/') +puts 'copying module' +all_template.each do |folder| + if folder.split('/')[-1] != 'mobile' + begin + system ('cp -r '+ app_path + '/modules/ ' + folder) + rescue + puts 'error copy' + end + end +end # Describe your gem and declare its dependencies: Gem::Specification.new do |s| diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb index db7ebe7..470c856 100644 --- a/app/controllers/ad_banners_controller.rb +++ b/app/controllers/ad_banners_controller.rb @@ -67,11 +67,45 @@ class AdBannersController < ApplicationController alt_text = (ad_b.title.nil? || ad_b.title == "" ? "ad-banner image" : ad_b.title) caption = i == 0 ? '
' : "" klass = i == 0 ? "active" : "" + if ad_b.link_open == "new_window" + target = "_blank" + else + target = "" + end + context = ad_b.context.tr('"',"'") rescue "" + alt_title = (ad_b.title.blank? ? "ad-banner image" : ad_b.title) if ad_b.exchange_item == "1" - image_html = " " + image_html = " " else ad_b.exchange_item == "2" youtube_url = format_url(ad_b.youtube,i) - image_html = " " + image_html = " " end images << { "html" => image_html @@ -83,8 +117,9 @@ class AdBannersController < ApplicationController "ad_fx" => adbanner.ad_fx, "speed" => adbanner.speed, "title" => adbanner.title, - "timeout" => adbanner.timeout, - "more" => "More" + "timeout" => (adbanner.timeout * 1000), + "more" => "More", + "desc" => adbanner.title }, "images" => images } diff --git a/app/views/admin/ad_banners/_form.html.erb b/app/views/admin/ad_banners/_form.html.erb index 609efbe..b2d8e89 100644 --- a/app/views/admin/ad_banners/_form.html.erb +++ b/app/views/admin/ad_banners/_form.html.erb @@ -47,7 +47,7 @@