summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-14 19:55:51 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-09-14 19:55:51 +0000
commitf2a058f8cf043d42f0ba8a007d807032a84545b0 (patch)
treeb187f9091459c8c452d546c3267711b581634d69
parent23264ec3eb8e17543922a0093ed402a9d7ba5de9 (diff)
downloadredmine-f2a058f8cf043d42f0ba8a007d807032a84545b0.tar.gz
redmine-f2a058f8cf043d42f0ba8a007d807032a84545b0.zip
Main project list now displays root projects with their subprojects.
Added files turned into links (if not removed) on the issue history. git-svn-id: http://redmine.rubyforge.org/svn/trunk@729 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/projects_controller.rb22
-rw-r--r--app/helpers/issues_helper.rb7
-rw-r--r--app/views/projects/list.rhtml33
-rw-r--r--public/stylesheets/application.css4
4 files changed, 28 insertions, 38 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 22d514f4d..710b6c188 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -46,23 +46,15 @@ class ProjectsController < ApplicationController
render :action => 'list' unless request.xhr?
end
- # Lists public projects
+ # Lists visible projects
def list
- sort_init "#{Project.table_name}.name", "asc"
- sort_update
- @project_count = Project.count(:all, :conditions => Project.visible_by(logged_in_user))
- @project_pages = Paginator.new self, @project_count,
- 15,
- params['page']
- @projects = Project.find :all, :order => sort_clause,
- :conditions => Project.visible_by(logged_in_user),
- :include => :parent,
- :limit => @project_pages.items_per_page,
- :offset => @project_pages.current.offset
-
- render :action => "list", :layout => false if request.xhr?
+ projects = Project.find :all,
+ :conditions => Project.visible_by(logged_in_user),
+ :include => :parent
+ @project_tree = projects.group_by {|p| p.parent || p}
+ @project_tree.each_key {|p| @project_tree[p] -= [p]}
end
-
+
# Add a new project
def add
@custom_fields = IssueCustomField.find(:all)
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index 756f142fa..8ef1de8f7 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -60,7 +60,12 @@ module IssuesHelper
label = content_tag('strong', label)
old_value = content_tag("i", h(old_value)) if detail.old_value
old_value = content_tag("strike", old_value) if detail.old_value and (!detail.value or detail.value.empty?)
- value = content_tag("i", h(value)) if value
+ if detail.property == 'attachment' && !value.blank? && Attachment.find_by_id(detail.prop_key)
+ # Link to the attachment if it has not been removed
+ value = link_to(value, :controller => 'attachments', :action => 'download', :id => detail.prop_key)
+ else
+ value = content_tag("i", h(value)) if value
+ end
end
if !detail.value.blank?
diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml
index 1fc3aab56..4474eef9f 100644
--- a/app/views/projects/list.rhtml
+++ b/app/views/projects/list.rhtml
@@ -1,30 +1,21 @@
<h2><%=l(:label_project_plural)%></h2>
-<table class="list">
- <thead><tr>
- <%= sort_header_tag("#{Project.table_name}.name", :caption => l(:label_project)) %>
- <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}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %><br />
- <%= textilizable project.description, :project => project %>
- </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>
+<dl class="projects">
+<% @project_tree.keys.sort.each do |project| %>
+<dt><%= link_to project.name, {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %>
+<dd><%= textilizable(project.description, :project => project) %>
+
+<% if @project_tree[project].any? %>
+ <%= l(:label_subproject_plural) %>:
+ <%= @project_tree[project].sort.collect {|subproject|
+ link_to(subproject.name, {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %>
+<% end %>
+</dd></dt>
<% end %>
- </tbody>
-</table>
+</dl>
<% if User.current.logged? %>
<div class="contextual">
<span class="icon icon-fav"><%= l(:label_my_projects) %></span>
</div>
<% end %>
-
-<%= pagination_links_full @project_pages %>
-[ <%= @project_pages.current.first_item %> - <%= @project_pages.current.last_item %> / <%= @project_count %> ]
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index 5b3e70246..064ff5ec6 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -118,7 +118,6 @@ background-repeat: no-repeat;
padding-left: 20px;
padding-top: 2px;
padding-bottom: 3px;
-vertical-align: middle;
}
#navigation .icon {
@@ -545,6 +544,9 @@ font-size: 1em;
.task_todo { background:#aaa url(../images/task_todo.png); border: 1px solid #aaa; }
.milestone { background-image:url(../images/milestone.png); background-repeat: no-repeat; border: 0; }
+/***** project list *****/
+dl.projects dt { font-size: 120%; margin-top:1.2em; padding: 2px 2px 4px 2px; background-color:#fafbfc; }
+
/***** Tooltips ******/
.tooltip{position:relative;z-index:24;}
.tooltip:hover{z-index:25;color:#000;}