aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-12-10 11:09:28 +0100
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-12-10 11:09:28 +0100
commit7af10e5fece53e4ce79fb2a990c74447d56adb3b (patch)
treeb147e58b22a977d48a673480c31f2a22ec54d3f1
parent1d645c191794a6b1b02344512b7e0b2f53a1bdfd (diff)
downloadsonarqube-7af10e5fece53e4ce79fb2a990c74447d56adb3b.tar.gz
sonarqube-7af10e5fece53e4ce79fb2a990c74447d56adb3b.zip
SONAR-2342 Keep only root resources in the recent activity
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb17
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb8
2 files changed, 13 insertions, 12 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb
index 32f7f4bafb3..ec8a68e1f8d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb
@@ -28,9 +28,18 @@
<script>
if (sonarRecentHistory == null) {
$j('#recent-history').detach();
- } else {
- sonarRecentHistory.add('<%= @resource ? @resource.key : "" -%>',
- '<%= @resource ? @resource.name : "" -%>',
- '<%= @resource ? Api::Utils.java_facade.getResourceType(@resource.qualifier).getIconPath() : "" -%>');
}
+
+ <%
+ if @resource
+ # we keep only root resources in the "Recent activity"
+ root_resource = @resource.root_project
+ %>
+ else {
+ sonarRecentHistory.add('<%= root_resource.key -%>',
+ '<%= root_resource.name -%>',
+ '<%= Api::Utils.java_facade.getResourceType(root_resource.qualifier).getIconPath() -%>');
+ }
+ <% end %>
+
</script> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
index 0765a7da521..1f452a265e9 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/index.html.erb
@@ -1,11 +1,3 @@
-<script>
- if (sonarRecentHistory != null) {
- sonarRecentHistory.add('<%= @resource.key -%>',
- '<%= @resource.name -%>',
- '<%= @resource ? Java::OrgSonarServerUi::JRubyFacade.getInstance().getResourceType(@resource.qualifier).getIconPath() : "" -%>');
- }
-</script>
-
<%= render :partial => 'tabs' -%>
<%= render :partial => "resource/header_#{@extension.getId()}" -%>