Commit de7fc6f7afcdc8856082eea24a960d94fd9feb20
Committed by
Diego Camarinha
1 parent
259f3e87
Exists in
master
and in
29 other branches
[Mezuro] Finished source tree navegation
Showing
3 changed files
with
20 additions
and
3 deletions
Show diff stats
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
| ... | ... | @@ -18,12 +18,13 @@ class MezuroPluginProfileController < ProfileController |
| 18 | 18 | def project_result |
| 19 | 19 | content = profile.articles.find(params[:id]) |
| 20 | 20 | project_result = content.project_result |
| 21 | + project = content.project | |
| 21 | 22 | if params[:module_name].nil? |
| 22 | 23 | source_tree = project_result.source_tree |
| 23 | 24 | else |
| 24 | 25 | source_tree = project_result.get_node(params[:module_name]) |
| 25 | 26 | end |
| 26 | - render :partial => 'content_viewer/project_result', :locals => { :project_result => project_result, :source_tree => source_tree } | |
| 27 | + render :partial => 'content_viewer/project_result', :locals => { :project_result => project_result, :source_tree => source_tree, :project => project } | |
| 27 | 28 | end |
| 28 | 29 | |
| 29 | 30 | def module_result | ... | ... |
plugins/mezuro/views/content_viewer/_project_result.rhtml
| ... | ... | @@ -14,6 +14,21 @@ |
| 14 | 14 | <td><%= project_result.formatted_analysis_time %></td> |
| 15 | 15 | </tr> |
| 16 | 16 | </table> |
| 17 | - | |
| 18 | 17 | <h4><%= _('Source tree') %></h4> |
| 19 | -<%= render :partial => 'content_viewer/source_tree', :locals => { :source_tree => source_tree } %> | |
| 18 | + | |
| 19 | +<% if !source_tree.nil? && project.name != source_tree.module.name %> | |
| 20 | + <a href="#" class="module-result-link" data-module-name="<%= project_result.source_tree %>"> | |
| 21 | + <%= project.name %> | |
| 22 | + </a> | |
| 23 | + <% split_link = source_tree.module.ancestor_names %> | |
| 24 | + <% split_link.each do |link| %> | |
| 25 | + <% if split_link.length - 1 != split_link.index(link) %> | |
| 26 | + <a href="#" class="module-result-link" data-module-name="<%= link %>"> | |
| 27 | + <%= link %> | |
| 28 | + </a> | |
| 29 | + <% end %> | |
| 30 | + <% end %> | |
| 31 | + <%= render :partial => 'content_viewer/source_tree', :locals => { :source_tree => source_tree } %> | |
| 32 | +<% else %> | |
| 33 | + <%= render :partial => 'content_viewer/source_tree', :locals => { :source_tree => project_result.source_tree } %> | |
| 34 | +<% end %> | ... | ... |