-class PanelPicture < Peta::Content
+class PanelPicture < Peta::Element
load_manifest
- include Peta::Element
include ElementInspire
belongs_to :panel
belongs_to :picture
def opt_img_tag spot = nil, opacity = 20
o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : ''
- {:id => self.tag_id(:img), :panel_id => self.tag_panel_id, :element_id => self.tag_element_id, :element_type => self.tag_element_type,
- :class => "panel-picture", :vPicture => self.id,
- :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption,
- :style => "#{o}"}
+ self.tag_attributes(:img, {
+ :class => "panel-picture", :vPicture => self.id,
+ :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption,
+ :style => "#{o}"
+ })
end
def tmb_opt_img_tag