From f530eb711265ae5b7374f25c51791eb66fc1e6e1 Mon Sep 17 00:00:00 2001
From: Matthew Kaito Juyuan Fu
Date: Fri, 3 Feb 2012 14:39:15 +0800
Subject: [PATCH] Revert "mistake commit"
This reverts commit 2608b72d653198ee4c0c5231e501d2e1d6079b69.
---
app/assets/javascripts/ad_banner.js | 2 +-
app/models/ad_banner.rb | 9 --------
app/models/ad_image.rb | 9 --------
app/views/admin/ad_banners/_form.html.erb | 1 -
app/views/admin/ad_banners/index.html.erb | 4 ----
lib/parsers/parser_front_end.rb | 25 -----------------------
6 files changed, 1 insertion(+), 49 deletions(-)
diff --git a/app/assets/javascripts/ad_banner.js b/app/assets/javascripts/ad_banner.js
index bab55a67..57176a1c 100644
--- a/app/assets/javascripts/ad_banner.js
+++ b/app/assets/javascripts/ad_banner.js
@@ -15,4 +15,4 @@ $('a.remove_mark').live("click",function(){
$(this).next().remove();
$(this).remove();
return false;
-});
+});
\ No newline at end of file
diff --git a/app/models/ad_banner.rb b/app/models/ad_banner.rb
index e7bffea4..368c7081 100644
--- a/app/models/ad_banner.rb
+++ b/app/models/ad_banner.rb
@@ -16,15 +16,6 @@ class AdBanner
embeds_many :ad_images, :cascade_callbacks => true
- FX_TYPES = ["blindX","blindY","blindZ","cover","curtainX","curtainY","fade","fadeZoom","growX","growY","scrollUp","scrollDown","scrollLeft","scrollRight","scrollHorz","scrollVert","shuffle","slideX","slideY","toss","turnUp","turnDown","turnLeft","turnRight","uncover","wipe","zoom"]
-
- def display?
- if (self.post_date <= Date.today && (self.unpost_date.nil? || self.unpost_date>= Date.today))
- return true
- end
- return false
- end
-
def new_ad_images=(*attrs)
attrs[0].each do |attr| #Loop by JSs,Themes,Imgs
unless attr[:file].nil?
diff --git a/app/models/ad_image.rb b/app/models/ad_image.rb
index 308ae3ac..dc8eab8b 100644
--- a/app/models/ad_image.rb
+++ b/app/models/ad_image.rb
@@ -13,13 +13,4 @@ class AdImage
embedded_in :ad_banner
- def get_delay_time
- time = ''
- if self.time_to_next.nil?
- time = '1000'
- else
- time = (self.time_to_next.to_i * 1000).to_s
- end
- time
- end
end
diff --git a/app/views/admin/ad_banners/_form.html.erb b/app/views/admin/ad_banners/_form.html.erb
index 2c42fa3b..ff19e513 100644
--- a/app/views/admin/ad_banners/_form.html.erb
+++ b/app/views/admin/ad_banners/_form.html.erb
@@ -24,7 +24,6 @@
<%= f.label :unpost_date, t('admin.unpost_date') %>
<%= f.date_select :unpost_date, :order => [:year, :month, :day], :use_month_numbers => true %>
- <%= f.date_select :unpost_date, :order => [:year, :month, :day], :use_month_numbers => true,:prompt => { :day => t('form.date_unlimited'), :month => t('form.date_unlimited'), :year => t('form.date_unlimited') } %>
<%= f.label :context, t('admin.context') %>
diff --git a/app/views/admin/ad_banners/index.html.erb b/app/views/admin/ad_banners/index.html.erb
index 30683cda..54217140 100644
--- a/app/views/admin/ad_banners/index.html.erb
+++ b/app/views/admin/ad_banners/index.html.erb
@@ -20,7 +20,6 @@
<%= t('admin.unpost_date') %> |
<%= t('admin.context') %> |
<%= t('admin.direct_to_after_click') %> |
- <%= t('admin.now_display?') %> |
<% @ad_banners.each do |ad_banner| %>
@@ -29,12 +28,9 @@
<%= ad_banner.picture_position %> |
<%= ad_banner.post_date %> |
<%= ad_banner.unpost_date %> |
- <%= ad_banner.unpost_date.nil?? t('form.date_unlimited'): ad_banner.unpost_date %> |
<%= ad_banner.context %> |
<%= ad_banner.direct_to_after_click %> |
- | <%= ad_banner.display? %> |
-
<%= link_to t(:show), admin_ad_banner_path(ad_banner), :class => 'show' %>
<%= link_to t(:edit), edit_admin_ad_banner_path(ad_banner), :class => 'edit' %>
<%= link_to t(:delete), admin_ad_banner_path(ad_banner), :confirm => t('sure?'), :method => :delete, :class => 'delete' %>
diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb
index 57b4be08..085da831 100644
--- a/lib/parsers/parser_front_end.rb
+++ b/lib/parsers/parser_front_end.rb
@@ -82,31 +82,6 @@ module ParserFrontEnd
end
res
end
- c.define_tag 'adbanner' do |tag|
- res = ''
- ad_banner = AdBanner.first(conditions:{title: tag.attr["name"]})
- if ad_banner.display?
- res << ""
- res << ""
-
- res << ""
- ad_banner.ad_images.each do |ad_image|
- res << " "
- end
- res << " "
- end
- res
- end
c.define_tag 'image' do |tag|
image = page.custom_images.detect{|image| image.name.eql?(tag.attr['name']) }
image = page.design.custom_images.detect{|image| image.name.eql?(tag.attr['name']) } unless image
|