'/pictures/' + self.filename
end
- def opt_img_tag opacity = nil
- o = opacity ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
+ def opt_img_tag spot = nil, opacity = 20
+ o = spot and spot != self ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
{:src => self.url, :vPicture => self.id, :width => self.width.abs, :height => self.height.abs, :alt => self.caption, :style => "top:#{self.y}px; left:#{self.x}px; z-index:#{self.z}; #{o}"}
end
end
def remove au
- PanelPicture.transaction do
- d = false
- panel_pictures_attributes = {}
-
- self.panel.panel_pictures.each do |panel_picture|
- attr = panel_picture.attributes
- if panel_picture == self
- attr['_destroy'] = true
- d = true
- else
- if d
- attr['t'] -= 1
- end
+ d = false
+ panel_pictures_attributes = {}
+ self.panel.panel_pictures.each do |panel_picture|
+ attr = panel_picture.attributes
+ if panel_picture == self
+ attr['_destroy'] = true
+ d = true
+ else
+ if d
+ attr['t'] -= 1
end
- panel_pictures_attributes[panel_picture.id] = attr
end
- self.panel.attributes = {:panel_pictures_attributes => panel_pictures_attributes}
- self.panel.store({}, au)
+ panel_pictures_attributes[panel_picture.id] = attr
end
+ self.panel.attributes = {:panel_pictures_attributes => panel_pictures_attributes}
+ self.panel.store({}, au)
end
def scenario