Browse Source

Added parent project name (if it exists) on project list and project overview.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@404 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.5.0
Jean-Philippe Lang 17 years ago
parent
commit
6e1b9326e4

+ 3
- 2
app/controllers/projects_controller.rb View File

@@ -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


+ 4
- 2
app/views/projects/list.rhtml View File

@@ -2,15 +2,17 @@

<table class="list">
<thead><tr>
<%= sort_header_tag('name', :caption => l(:label_project)) %>
<%= sort_header_tag("#{Project.table_name}.name", :caption => l(:label_project)) %>
<th><%=l(:field_description)%></th>
<%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
<th><%=l(:field_parent)%></th>
<%= sort_header_tag("#{Project.table_name}.created_on", :caption => l(:field_created_on)) %>
</tr></thead>
<tbody>
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :action => 'show', :id => project %></td>
<td><%=h project.description %></td>
<td><%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %></td>
<td align="center"><%= format_date(project.created_on) %></td>
</tr>
<% end %>

+ 3
- 0
app/views/projects/show.rhtml View File

@@ -9,6 +9,9 @@
<ul>
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
<% unless @project.parent.nil? %>
<li><%=l(:field_parent)%>: <%= link_to @project.parent.name, :controller => 'projects', :action => 'show', :id => @project.parent %></li>
<% end %>
<% for custom_value in @custom_values %>
<% if !custom_value.value.empty? %>
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>

Loading…
Cancel
Save