OSDN Git Service

element
[pettanr/pettanr.git] / app / models / panel_picture.rb
index 12e88aa..4c463d9 100644 (file)
@@ -1,6 +1,5 @@
-class PanelPicture < Peta::Content
+class PanelPicture < Peta::Element
   load_manifest
-  include Peta::Element
   include ElementInspire
   belongs_to :panel
   belongs_to :picture
@@ -94,10 +93,11 @@ class PanelPicture < Peta::Content
   
   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