- <div class="<%= bay.dom_bodys_class -%>" <%= raw @panel.tag_attr(:scenario) -%>>
- <% bay.tabs.each do |board| %>
- <%= render board.body.bucket.template_name, :form => board.body.bucket %>
- <% end %>
- </div>
+<div class="<%= bay.dom_bodys_class -%>" <%= raw @panel.tag_attr(:scenario) -%>>
+ <% bay.tabs.each do |board| %>
+ <%= render board.body.bucket.template_name, board.body.bucket.template_options %>
+ <% end %>
+</div>
<div id="<%= bay.body.dom_id -%>" class="<%= bay.body.dom_class -%>">
- <%= render bay.body.bucket.template_name, :form => bay.body.bucket %>
+ <%= render bay.body.bucket.template_name, bay.body.bucket.template_options %>
</div>
--- /dev/null
+vvvvvvvvv\r
--- /dev/null
+ <% bay.elements.each do |elm| %>\r
+ <div <%= raw elm.tag_attr() -%>>\r
+ <%= render elm.scenario_template, :elm => elm, :no_attr => 0 %>\r
+ </div>\r
+ <% end %>\r
def initialize parent
super
- @bucket = FormBucket.new self, 'form'
+ @bucket = ScenarioBucket.new self
# form_manager = Pettanr::Application::manifest.form_managers[self.root_item.form_name]
# form = form_manager.open self.root_item, @dock_body.dock.editor.operators, mounted
def initialize parent, index, name
super
- self.root_item.panel_elements.each_with_index do |element, i|
+ self.elements.each_with_index do |element, i|
tab = TorderBoard.new(self, i, element.item_name, element)
add_tab tab, TorderBoardLabel.new(tab, element.item_name),
TorderBoardBody.new(tab)
end
end
+ def elements
+ self.root_item.panel_elements
+ end
+
def class_name
"tsort-box"
end
end
def bay
- self.board.parent
+ self.board.bay
+ end
+
+ def dock
+ self.bay.dock
end
def element
end
class BoardBody < Body
+ def board
+ @parent
+ end
+
+ def bay
+ self.board.bay
+ end
+
+ def dock
+ self.bay.dock
+ end
+
def dom_id
self.board.dom_id + '-body'
end
@parent = parent
end
- def root_item
- @parent.root_item
+ def template_dir
+ raise "no template_dir"
end
- def template_dir
- @parent.template_dir
+ def template_file_name
+ raise "no template_file_name"
end
def template_name
self.template_dir + self.template_file_name
end
- def class_name
- "elements-tabs"
- end
-
end
class FormBucket < Bucket
+ attr_accessor :form
def initialize parent, form
- @parent = parent
+ super parent
+ @form = form
end
- def root_item
- @parent.root_item
+ def template_dir
+ @parent.dock.template_dir
+ end
+
+ def template_file_name
+ 'bucket/element_form'
+ end
+
+ def template_options
+ {:form => @form}
+ end
+
+ end
+
+ class ScenarioBucket < Bucket
+ def board
+ @parent.board
+ end
+
+ def bay
+ self.board.bay
+ end
+
+ def template_dir
+ @parent.dock.template_dir
end
def template_file_name
- 'element_form'
+ 'bucket/scenario'
end
- def class_name
- "elements-tabs"
+ def template_options
+ {:bay => self.bay}
end
end