Mercurial > hg > soundsoftware-site
comparison app/controllers/projects_controller.rb @ 125:ca48d8b6f55d cannam
* Show Public or Private next to my projects; fix ordering of my projects so as to retain hierarchy
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Tue, 18 Jan 2011 17:22:18 +0000 |
parents | bc91f2025d05 |
children | 73ff0e6a11b1 |
comparison
equal
deleted
inserted
replaced
124:bc91f2025d05 | 125:ca48d8b6f55d |
---|---|
53 @project_count = Project.visible.count | 53 @project_count = Project.visible.count |
54 @project_pages = Paginator.new self, @project_count, @limit, params['page'] | 54 @project_pages = Paginator.new self, @project_count, @limit, params['page'] |
55 @offset ||= @project_pages.current.offset | 55 @offset ||= @project_pages.current.offset |
56 @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause) | 56 @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause) |
57 if User.current.logged? | 57 if User.current.logged? |
58 @user_projects = User.current.projects | 58 @user_projects = User.current.projects.sort_by(&:lft) |
59 end | 59 end |
60 render :template => 'projects/index.rhtml', :layout => !request.xhr? | 60 render :template => 'projects/index.rhtml', :layout => !request.xhr? |
61 } | 61 } |
62 format.api { | 62 format.api { |
63 @offset, @limit = api_offset_and_limit | 63 @offset, @limit = api_offset_and_limit |