class PanelPicture < ActiveRecord::Base
+ include Element
+ include ElementInspire
belongs_to :panel
belongs_to :picture
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)
end
def remove au
- 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
- end
- panel_pictures_attributes[panel_picture.id] = attr
- end
- self.panel.attributes = {:panel_pictures_attributes => panel_pictures_attributes}
- self.panel.store({}, au)
+ self.panel.remove_element(self, au)
end
def scenario