]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3862 Rename "entities" into "all_projects"
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Wed, 5 Dec 2012 14:00:17 +0000 (15:00 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Wed, 5 Dec 2012 14:01:02 +0000 (15:01 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/all_projects_controller.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/controllers/entities_controller.rb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/all_projects/index.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/entities/index.html.erb [deleted file]
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_menu_projects.html.erb

index 1321293bbf21bc95ee73a3ced9e96707b7a04a03..5ed67de4d59fe12574f74b6858f3d81f53dcfb7d 100644 (file)
@@ -499,12 +499,12 @@ reviews.filtered_by.to=To date
 
 #------------------------------------------------------------------------------
 #
-# ENTITIES PAGE
+# ALL PROJECTS PAGE
 #
 #------------------------------------------------------------------------------
 
-entities.cols.name=Name
-entities.cols.key=Key
+all-projects.cols.name=Name
+all-projects.cols.key=Key
 
 
 #------------------------------------------------------------------------------
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/all_projects_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/all_projects_controller.rb
new file mode 100644 (file)
index 0000000..51bb0da
--- /dev/null
@@ -0,0 +1,36 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2012 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
+#
+class AllProjectsController < ApplicationController
+
+  SECTION=Navigation::SECTION_HOME
+  
+  def index
+    require_parameters :qualifier
+    @qualifier = params[:qualifier]
+    bad_request("The 'qualifier' parameter is not valid. It must reference a root type.") unless Project.root_qualifiers.include?(@qualifier)
+    
+    
+    @filter = MeasureFilter.new
+    @filter.criteria = params.merge({'qualifiers' => [@qualifier], 'cols' => ['name', 'description', 'key', 'links']})
+    @filter.enable_default_display
+    @filter.execute(self, :user => current_user)
+  end
+
+end
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/entities_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/entities_controller.rb
deleted file mode 100644 (file)
index 21a3cb1..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Sonar, entreprise quality control tool.
-# Copyright (C) 2008-2012 SonarSource
-# mailto:contact AT sonarsource DOT com
-#
-# Sonar is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# Sonar is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with Sonar; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
-#
-class EntitiesController < ApplicationController
-
-  SECTION=Navigation::SECTION_HOME
-  
-  def index
-    require_parameters :qualifier
-    @qualifier = params[:qualifier]
-    bad_request("The 'qualifier' parameter is not valid. It must reference a root type.") unless Project.root_qualifiers.include?(@qualifier)
-    
-    
-    @filter = MeasureFilter.new
-    @filter.criteria = params.merge({'qualifiers' => [@qualifier], 'cols' => ['name', 'description', 'key', 'links']})
-    @filter.enable_default_display
-    @filter.execute(self, :user => current_user)
-  end
-
-end
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/all_projects/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/all_projects/index.html.erb
new file mode 100644 (file)
index 0000000..a13cf47
--- /dev/null
@@ -0,0 +1,106 @@
+<% content_for :script do %>
+  <script>
+    function removeUrlAttr(url, attribute_key) {
+      var regexp = new RegExp("&?" + attribute_key + "=([^&]$|[^&]*)", "g");
+      return url.replace(regexp, '');
+    }
+    function reloadParameters(params) {
+      var url = decodeURI(window.location.href);
+      $j.each(params, function (key, value) {
+        url = removeUrlAttr(url, key);
+        url += '&' + key + '=' + value;
+      });
+      window.location = url;
+    }
+  </script>
+<% end %>
+
+<% if @filter.results %>
+
+  <h1><%= message('qualifiers.all.' + @qualifier) -%></h1>
+  <br/>
+
+  <div id="all-projects">
+
+    <% if @filter.security_exclusions %>
+      <p class="notes"><%= message('results_not_display_due_to_security') -%></p>
+    <% end %>
+
+    <%
+      display_favourites = logged_in?
+      colspan = 7
+      colspan += 1 if display_favourites
+    %>
+
+    <table class="data" id="all-projects-table">
+      <thead>
+        <tr>
+          <% if display_favourites %>
+            <th class="thin" style></th>
+          <% end %>
+          <th class="thin">
+            <%= link_to_function( message('all-projects.cols.name'), "reloadParameters({asc:'#{(!@filter.sort_asc?).to_s}', sort:'name'})") -%>
+            <% if @filter.sort_key=='name' %>
+              <%= @filter.sort_asc? ? image_tag("asc12.png") : image_tag("desc12.png") -%>
+            <% end %>
+          </th>
+          <th></th>
+          <th>
+            <%= link_to_function( message('all-projects.cols.key'), "reloadParameters({asc:'#{(!@filter.sort_asc?).to_s}', sort:'key'})") -%>
+            <% if @filter.sort_key=='key' %>
+              <%= @filter.sort_asc? ? image_tag("asc12.png") : image_tag("desc12.png") -%>
+            <% end %>
+          </th>
+          <th></th>
+          <th></th>
+          <th></th>
+          <th></th>
+        </tr>
+      </thead>
+  
+      <tbody>
+        <% @filter.results.each do |result| %>
+          <tr class="<%= cycle 'even', 'odd' -%>">
+            <% if display_favourites %>
+              <td class="thin"><%= link_to_favourite(result.snapshot.resource) -%></td>
+            <% end %>
+            <td class="nowrap">
+              <%= qualifier_icon(result.snapshot)-%> <%= link_to(result.snapshot.resource.name(true), {:controller => 'dashboard', :id => result.snapshot.resource_id}, :title => result.snapshot.resource.key) -%>
+            </td>
+            <td class="sep"></td>
+            <td class="nowrap">
+              <span class='small'><%= result.snapshot.resource.kee -%></span>
+            </td>
+            <td class="sep"></td>
+            <td>
+              <%= h result.snapshot.resource.description -%>
+            </td>
+            <td class="sep"></td>
+            <td class="nowrap right">
+              <% 
+                 if result.links
+                   result.links.select { |link| link.href.start_with?('http') }.each do |link|
+              %>
+                <%= link_to(image_tag(link.icon, :alt => link.name), link.href, :class => 'nolink', :popup => true) unless link.custom? -%>
+              <%
+                   end
+                 end
+              %>
+            </td>
+          </tr>
+        <% end %>
+        
+        <% if @filter.results.empty? %>
+          <tr class="even">
+            <td colspan="<%= colspan -%>"><%= message 'no_data' -%></td>
+          </tr>
+        <% end %>
+    </tbody>
+    
+    <%= render :partial => 'utils/tfoot_pagination', :locals => {:pagination => @filter.pagination, :colspan => colspan} %>
+    
+  </table>
+
+  </div>
+  
+<% end %>
\ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/entities/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/entities/index.html.erb
deleted file mode 100644 (file)
index 82fb5fd..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<% content_for :script do %>
-  <script>
-    function removeUrlAttr(url, attribute_key) {
-      var regexp = new RegExp("&?" + attribute_key + "=([^&]$|[^&]*)", "g");
-      return url.replace(regexp, '');
-    }
-    function reloadParameters(params) {
-      var url = decodeURI(window.location.href);
-      $j.each(params, function (key, value) {
-        url = removeUrlAttr(url, key);
-        url += '&' + key + '=' + value;
-      });
-      window.location = url;
-    }
-  </script>
-<% end %>
-
-<% if @filter.results %>
-
-  <h1><%= message('qualifiers.all.' + @qualifier) -%></h1>
-  <br/>
-
-  <div id="entities">
-
-    <% if @filter.security_exclusions %>
-      <p class="notes"><%= message('results_not_display_due_to_security') -%></p>
-    <% end %>
-
-    <%
-      display_favourites = logged_in?
-      colspan = 7
-      colspan += 1 if display_favourites
-    %>
-
-    <table class="data" id="entities-table">
-      <thead>
-        <tr>
-          <% if display_favourites %>
-            <th class="thin" style></th>
-          <% end %>
-          <th class="thin">
-            <%= link_to_function( message('entities.cols.name'), "reloadParameters({asc:'#{(!@filter.sort_asc?).to_s}', sort:'name'})") -%>
-            <% if @filter.sort_key=='name' %>
-              <%= @filter.sort_asc? ? image_tag("asc12.png") : image_tag("desc12.png") -%>
-            <% end %>
-          </th>
-          <th></th>
-          <th>
-            <%= link_to_function( message('entities.cols.key'), "reloadParameters({asc:'#{(!@filter.sort_asc?).to_s}', sort:'key'})") -%>
-            <% if @filter.sort_key=='key' %>
-              <%= @filter.sort_asc? ? image_tag("asc12.png") : image_tag("desc12.png") -%>
-            <% end %>
-          </th>
-          <th></th>
-          <th></th>
-          <th></th>
-          <th></th>
-        </tr>
-      </thead>
-  
-      <tbody>
-        <% @filter.results.each do |result| %>
-          <tr class="<%= cycle 'even', 'odd' -%>">
-            <% if display_favourites %>
-              <td class="thin"><%= link_to_favourite(result.snapshot.resource) -%></td>
-            <% end %>
-            <td class="nowrap">
-              <%= qualifier_icon(result.snapshot)-%> <%= link_to(result.snapshot.resource.name(true), {:controller => 'dashboard', :id => result.snapshot.resource_id}, :title => result.snapshot.resource.key) -%>
-            </td>
-            <td class="sep"></td>
-            <td class="nowrap">
-              <span class='small'><%= result.snapshot.resource.kee -%></span>
-            </td>
-            <td class="sep"></td>
-            <td>
-              <%= h result.snapshot.resource.description -%>
-            </td>
-            <td class="sep"></td>
-            <td class="nowrap right">
-              <% 
-                 if result.links
-                   result.links.select { |link| link.href.start_with?('http') }.each do |link|
-              %>
-                <%= link_to(image_tag(link.icon, :alt => link.name), link.href, :class => 'nolink', :popup => true) unless link.custom? -%>
-              <%
-                   end
-                 end
-              %>
-            </td>
-          </tr>
-        <% end %>
-        
-        <% if @filter.results.empty? %>
-          <tr class="even">
-            <td colspan="<%= colspan -%>"><%= message 'no_data' -%></td>
-          </tr>
-        <% end %>
-    </tbody>
-    
-    <%= render :partial => 'utils/tfoot_pagination', :locals => {:pagination => @filter.pagination, :colspan => colspan} %>
-    
-  </table>
-
-  </div>
-  
-<% end %>
\ No newline at end of file
index 30107900edcd1264bd9b6b5bf2bc0ee02f095fd2..2a9604974e9826b27d243f0de46eac9279d1224f 100644 (file)
@@ -17,7 +17,7 @@
     <div>
       <ul>
         <% Project.root_qualifiers.sort.each do |qualifier| %>      
-          <li><a href="<%= ApplicationController.root_context -%>/entities?qualifier=<%= qualifier -%>"><%= message('qualifiers.all.' + qualifier) -%></a></li>
+          <li><a href="<%= ApplicationController.root_context -%>/all_projects?qualifier=<%= qualifier -%>"><%= message('qualifiers.all.' + qualifier) -%></a></li>
         <% end %>
       </ul>
     </div>