2011-08-08 01:30:44 +00:00
|
|
|
class Layout < DesignFile
|
2011-08-10 09:28:10 +00:00
|
|
|
include Parser
|
2011-08-08 01:30:44 +00:00
|
|
|
embedded_in :design
|
2011-05-18 02:00:00 +00:00
|
|
|
|
2011-08-08 04:29:32 +00:00
|
|
|
attr_reader :content
|
2011-08-18 08:27:04 +00:00
|
|
|
embeds_many :layout_parts
|
2011-05-18 02:00:00 +00:00
|
|
|
|
2011-08-08 04:29:32 +00:00
|
|
|
def content
|
|
|
|
self.file.read
|
|
|
|
end
|
2011-08-10 09:28:10 +00:00
|
|
|
|
2011-05-18 02:00:00 +00:00
|
|
|
def self.exist_one?
|
|
|
|
Layout.count > 0
|
|
|
|
end
|
2011-08-10 09:28:10 +00:00
|
|
|
|
|
|
|
after_save:parse_layout
|
|
|
|
|
|
|
|
def parse_layout
|
|
|
|
parse_layout_layout_part(self)
|
|
|
|
end
|
2011-03-08 09:25:46 +00:00
|
|
|
end
|