OSDN Git Service

t#31779:element lib
[pettanr/pettanr.git] / app / models / ground_picture.rb
index f413ae7..5042868 100644 (file)
@@ -1,4 +1,6 @@
 class GroundPicture < ActiveRecord::Base
+  include Element
+  include ElementInspire
   belongs_to :panel
   belongs_to :picture
   
@@ -21,6 +23,32 @@ class GroundPicture < ActiveRecord::Base
     end
   end
   
+  def self.list_opt_for_panel
+    {
+      :ground_pictures => {
+        :picture => {:artist => {}, :license => {}}
+      }
+    }
+  end
+  
+  def self.show_opt_for_panel
+    {
+      :ground_pictures => {
+        :picture => {:artist => {}, :license => {}}
+      }
+    }
+  end
+  
+  def self.json_opt_for_panel
+    {
+      :picture => {:artist => {}, :license => {}}
+    }
+  end
+  
+  def self.has_picture?
+    true
+  end
+  
   def supply_default
     self.x = 0
     self.y = 0
@@ -183,14 +211,6 @@ class GroundPicture < ActiveRecord::Base
     self.panel.remove_element(self, au)
   end
   
-  def copy from_panel
-    r = GroundPicture.new self.attributes
-    r.panel_id = from_panel.id
-    r.t = r.panel.new_t 
-    r.z = r.panel.new_z 
-    r
-  end
-  
   def scenario
     if caption.blank?
       ''