Ad banner close complete,need validation

This commit is contained in:
Matthew Kaito Juyuan Fu authored and Christophe Vilayphiou committed 2012-02-04 09:37:23 +08:00
1 parent 68cea1ea49
commit 394099c388
8 files changed
+55 -17

No files matched your search

+7
View File
@@ -18,6 +18,13 @@ class AdBanner
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?
+13
View File
@@ -7,10 +7,23 @@ class AdImage
field :time_to_next #Weight
field :picture_intro
field :out_link
field :link_open
field :to_save, :type => Boolean
field :to_destroy, :type => Boolean
LINK_OPEN_TYPES = ["new_window","local"]
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