diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 22d514f..710b6c1 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 756f142..8ef1de8 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 1fc3aab..4474eef 100644 --- a/app/views/projects/list.rhtml +++ b/app/views/projects/list.rhtml @@ -1,30 +1,21 @@
<%=l(:field_parent)%> | - <%= sort_header_tag("#{Project.table_name}.created_on", :caption => l(:field_created_on)) %> -||
---|---|---|
- <%= link_to project.name, {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %> - <%= textilizable project.description, :project => project %> - |
- <%= link_to(project.parent.name, :action => 'show', :id => project.parent) unless project.parent.nil? %> | -<%= format_date(project.created_on) %> | -