second and third levels for register view

This commit is contained in:
Torsten Ruger 2015-08-14 20:27:06 +03:00
parent 5583a7a56c
commit 08fba7129b
2 changed files with 29 additions and 23 deletions

View File

@ -23,11 +23,6 @@ module Main
var.class.name.split("::").last[0,2] var.class.name.split("::").last[0,2]
end end
def variables val
name = val.class.name.split("::").last
ClassesController.variables(name)
end
def content(id) def content(id)
object = Virtual.machine.objects[id] object = Virtual.machine.objects[id]
fields = [] fields = []
@ -43,17 +38,8 @@ module Main
fields fields
end end
def variables(attribute) def is_object?( id )
model_name = attribute.class.name.split("::").last Virtual.machine.objects[id] != nil
vars = []
cl = Virtual.machine.space.get_class_by_name(model_name)
return vars unless cl
layout = cl.object_layout
layout.object_instance_names.each do |name|
vars.push name
end
vars
end end
end end
end end

View File

@ -13,13 +13,33 @@
{{index}}{{marker(attribute)}} {{index}}{{marker(attribute)}}
{{attribute.object_id}} {{attribute.object_id}}
</a> </a>
<ul> {{ if(is_object?(attribute.object_id)) }}
{{content(attribute.object_id).each do |con| }} <ul>
<li> {{content(attribute.object_id).each do |con| }}
<a href="#">{{con[0]}}</a> <li>
</li> <a href="#">{{con[0]}}</a>
{{end}} {{ if is_object?( con[1])}}
</ul> <ul>
{{content(con[1]).each do |con2| }}
<li>
<a href="#">{{con2[0]}}</a>
{{ if is_object?( con2[1])}}
<ul>
{{content(con2[1]).each do |con3| }}
<li>
<a href="#">{{con3[0]}}</a>
</li>
{{end}}
</ul>
{{ end }}
</li>
{{end}}
</ul>
{{ end }}
</li>
{{end}}
</ul>
{{ end }}
</li> </li>
{{end}} {{end}}
</ul> </ul>