diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 317dcaff6..5f188a4dd 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -39,14 +39,15 @@ class ProjectsController < ApplicationController # Lists public projects def list - sort_init 'name', 'asc' + sort_init "#{Project.table_name}.name", "asc" sort_update @project_count = Project.count(:all, :conditions => ["is_public=?", true]) @project_pages = Paginator.new self, @project_count, 15, params['page'] @projects = Project.find :all, :order => sort_clause, - :conditions => ["is_public=?", true], + :conditions => ["#{Project.table_name}.is_public=?", true], + :include => :parent, :limit => @project_pages.items_per_page, :offset => @project_pages.current.offset diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml index 5e1a63f95..f83dc0d06 100644 --- a/app/views/projects/list.rhtml +++ b/app/views/projects/list.rhtml @@ -2,15 +2,17 @@ - <%= sort_header_tag('name', :caption => l(:label_project)) %> + <%= sort_header_tag("#{Project.table_name}.name", :caption => l(:label_project)) %> - <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %> + + <%= sort_header_tag("#{Project.table_name}.created_on", :caption => l(:field_created_on)) %> <% for project in @projects %> "> + <% end %> diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index 8b0501585..98259f1f8 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -9,6 +9,9 @@
<%=l(:field_description)%><%=l(:field_parent)%>
<%= link_to project.name, :action => 'show', :id => project %> <%=h project.description %><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %> <%= format_date(project.created_on) %>