#コマ
-class Panel < Pettanr::Content
+class Panel < Peta::Content
+ load_manifest
belongs_to :author
has_many :scroll_panels
has_many :sheet_panels
end
def self.each_element_class_names
- Pettanr::Application.manifest.system_resources.elements.each do |k, n|
+ Manifest.manifest.system_resources.elements.each do |k, n|
yield k
end
end
end
def visible? operators
- return false unless super
+ return true if super
return true if self.new_record?
self.publish?
end
self.publish > 0
end
+ # ground_picture element template
+ def style_wh
+ {
+ 'width' => self.width.to_s + 'px', 'height' => self.height.to_s + 'px'
+ }
+ end
+
def tag_id c = nil
'panel' + self.tag_panel_id + c.to_s
end
def select_tag_attributes(selected, column, opt = {})
[
- :last, :first,
{:html => {:selected => selected}},
self.field_tag_attributes(column, opt)
]
end
- def field_tag_attributes column, opt = {}
+ def field_tag_attributes column, no_attr, opt = {}
self.tag_attributes(column).merge(
{:column => column}
).merge(opt)