diff --git a/plugins/mezuro/lib/kalibro/entities/module_node.rb b/plugins/mezuro/lib/kalibro/entities/module_node.rb
index 72e4005..4ca81a6 100644
--- a/plugins/mezuro/lib/kalibro/entities/module_node.rb
+++ b/plugins/mezuro/lib/kalibro/entities/module_node.rb
@@ -6,6 +6,14 @@ class Kalibro::Entities::ModuleNode < Kalibro::Entities::Entity
@module = to_entity(value, Kalibro::Entities::Module)
end
+ def module_name
+ @module.name
+ end
+
+ def granularity
+ @module.granularity
+ end
+
def child=(value)
@child = to_entity_array(value, Kalibro::Entities::ModuleNode)
end
@@ -18,30 +26,4 @@ class Kalibro::Entities::ModuleNode < Kalibro::Entities::Entity
@child = children
end
- def print
- cell = "
#{@module.name} (#{@module.granularity}) | "
- return "" if @child.nil?
-
- id = @module.name
- "" +
- "" +
- "" +
- " " +
- " " +
- " | " +
- cell +
- "
" +
- "" +
- " | " +
- "" +
- @child.collect { |child| child.print }.to_s +
- " | " +
- "
" +
- "
"
- end
-
-end
\ No newline at end of file
+end
diff --git a/plugins/mezuro/views/content_viewer/_source_tree.rhtml b/plugins/mezuro/views/content_viewer/_source_tree.rhtml
new file mode 100644
index 0000000..e62f146
--- /dev/null
+++ b/plugins/mezuro/views/content_viewer/_source_tree.rhtml
@@ -0,0 +1,30 @@
+<% if source_tree.children && !source_tree.children.empty? %>
+
+
+
+
+
+ |
+ <%= source_tree.module_name %> (<%= source_tree.granularity %>) |
+
+
+ |
+
+ <% source_tree.children.each do |child| %>
+ <%= render :partial => 'source_tree', :locals => { :source_tree => child } %>
+ <% end %>
+ |
+
+
+<% else %>
+
+
+ |
+ <%= source_tree.module_name %> (<%= source_tree.granularity %>) |
+
+
+<% end %>
diff --git a/plugins/mezuro/views/content_viewer/show_project.rhtml b/plugins/mezuro/views/content_viewer/show_project.rhtml
index 8a5f53f..74b20f9 100644
--- a/plugins/mezuro/views/content_viewer/show_project.rhtml
+++ b/plugins/mezuro/views/content_viewer/show_project.rhtml
@@ -67,7 +67,7 @@
<%= _('Source tree') %>
- <%= @project_result.source_tree.print %>
+ <%= render :partial => 'source_tree', :locals => { :source_tree => @project_result.source_tree } %>
<% @module_result = @page.module_result(@project.name) %>
--
libgit2 0.21.2