#------------------------------------------------------------------------------
#
-# ENTITIES PAGE
+# ALL PROJECTS PAGE
#
#------------------------------------------------------------------------------
-entities.cols.name=Name
-entities.cols.key=Key
+all-projects.cols.name=Name
+all-projects.cols.key=Key
#------------------------------------------------------------------------------
--- /dev/null
+#
+# 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
+++ /dev/null
-#
-# 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
--- /dev/null
+<% 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
+++ /dev/null
-<% 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
<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>