Projects menu item now shows the list of public projects and projects for which the user is a member (marked with a star).

If current user is admin, private projects are also listed.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@460 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-04-21 16:40:56 +00:00
parent 634d3557f2
commit 623d2f25b1
3 changed files with 17 additions and 8 deletions

View File

@@ -41,12 +41,12 @@ class ProjectsController < ApplicationController
def list
sort_init "#{Project.table_name}.name", "asc"
sort_update
@project_count = Project.count(:all, :conditions => ["is_public=?", true])
@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.table_name}.is_public=?", true],
:conditions => Project.visible_by(logged_in_user),
:include => :parent,
:limit => @project_pages.items_per_page,
:offset => @project_pages.current.offset