X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fmodels%2Fpanel.rb;h=1c81e698e309be6903b28c2bfbac14afa7b975bf;hb=ac6610b290db53f3914b593963fef972eb4cfa82;hp=3acafc8eb0cf48e740b7576448bb0ef59a40573b;hpb=d11232cf3353a67172657b902fd535214f8fa899;p=pettanr%2Fpettanr.git diff --git a/app/models/panel.rb b/app/models/panel.rb index 3acafc8e..1c81e698 100644 --- a/app/models/panel.rb +++ b/app/models/panel.rb @@ -1,5 +1,6 @@ #コマ -class Panel < Pettanr::Content +class Panel < Peta::Content + load_manifest belongs_to :author has_many :scroll_panels has_many :sheet_panels @@ -23,7 +24,7 @@ class Panel < Pettanr::Content 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 @@ -67,6 +68,13 @@ class Panel < Pettanr::Content 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 @@ -87,13 +95,12 @@ class Panel < Pettanr::Content 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)