OSDN Git Service

t#31779:element lib
[pettanr/pettanr.git] / app / models / panel_picture.rb
index 73cbc03..64f990c 100644 (file)
@@ -1,4 +1,6 @@
 class PanelPicture < ActiveRecord::Base
+  include Element
+  include ElementInspire
   belongs_to :panel
   belongs_to :picture
   
@@ -21,6 +23,32 @@ class PanelPicture < ActiveRecord::Base
     end
   end
   
+  def self.list_opt_for_panel
+    {
+      :panel_pictures => {
+        :picture => {:artist => {}, :license => {}}
+      }
+    }
+  end
+  
+  def self.show_opt_for_panel
+    {
+      :panel_pictures => {
+        :picture => {:artist => {}, :license => {}}
+      }
+    }
+  end
+  
+  def self.json_opt_for_panel
+    {
+      :picture => {:artist => {}, :license => {}}
+    }
+  end
+  
+  def self.has_picture?
+    true
+  end
+  
   def visible? roles
     if MagicNumber['run_mode'] == 0
       return false unless guest_role_check(roles)
@@ -203,14 +231,6 @@ class PanelPicture < ActiveRecord::Base
     self.panel.remove_element(self, au)
   end
   
-  def copy from_panel
-    r = PanelPicture.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?
       ''