@@ -39,14 +39,15 class ProjectsController < ApplicationController | |||
|
39 | 39 | |
|
40 | 40 | # Lists public projects |
|
41 | 41 | def list |
|
42 |
sort_init |
|
|
42 | sort_init "#{Project.table_name}.name", "asc" | |
|
43 | 43 | sort_update |
|
44 | 44 | @project_count = Project.count(:all, :conditions => ["is_public=?", true]) |
|
45 | 45 | @project_pages = Paginator.new self, @project_count, |
|
46 | 46 | 15, |
|
47 | 47 | params['page'] |
|
48 | 48 | @projects = Project.find :all, :order => sort_clause, |
|
49 | :conditions => ["is_public=?", true], | |
|
49 | :conditions => ["#{Project.table_name}.is_public=?", true], | |
|
50 | :include => :parent, | |
|
50 | 51 | :limit => @project_pages.items_per_page, |
|
51 | 52 | :offset => @project_pages.current.offset |
|
52 | 53 |
@@ -2,15 +2,17 | |||
|
2 | 2 | |
|
3 | 3 | <table class="list"> |
|
4 | 4 | <thead><tr> |
|
5 |
<%= sort_header_tag( |
|
|
5 | <%= sort_header_tag("#{Project.table_name}.name", :caption => l(:label_project)) %> | |
|
6 | 6 | <th><%=l(:field_description)%></th> |
|
7 | <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %> | |
|
7 | <th><%=l(:field_parent)%></th> | |
|
8 | <%= sort_header_tag("#{Project.table_name}.created_on", :caption => l(:field_created_on)) %> | |
|
8 | 9 | </tr></thead> |
|
9 | 10 | <tbody> |
|
10 | 11 | <% for project in @projects %> |
|
11 | 12 | <tr class="<%= cycle("odd", "even") %>"> |
|
12 | 13 | <td><%= link_to project.name, :action => 'show', :id => project %></td> |
|
13 | 14 | <td><%=h project.description %></td> |
|
15 | <td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td> | |
|
14 | 16 | <td align="center"><%= format_date(project.created_on) %></td> |
|
15 | 17 | </tr> |
|
16 | 18 | <% end %> |
@@ -9,6 +9,9 | |||
|
9 | 9 | <ul> |
|
10 | 10 | <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %> |
|
11 | 11 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> |
|
12 | <% unless @project.parent.nil? %> | |
|
13 | <li><%=l(:field_parent)%>: <%= link_to @project.parent.name, :controller => 'projects', :action => 'show', :id => @project.parent %></li> | |
|
14 | <% end %> | |
|
12 | 15 | <% for custom_value in @custom_values %> |
|
13 | 16 | <% if !custom_value.value.empty? %> |
|
14 | 17 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> |
General Comments 0
You need to be logged in to leave comments.
Login now