comparison app/controllers/projects_controller.rb @ 133:1890a968b404 cannam-pre-20110113-merge

* 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 ab611b7c7ecc
children 05f9a2a9c753 c09865a48f4e
comparison
equal deleted inserted replaced
132:ab611b7c7ecc 133:1890a968b404
56 @project_count = Project.visible.count 56 @project_count = Project.visible.count
57 @project_pages = Paginator.new self, @project_count, @limit, params['page'] 57 @project_pages = Paginator.new self, @project_count, @limit, params['page']
58 @offset ||= @project_pages.current.offset 58 @offset ||= @project_pages.current.offset
59 @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause) 59 @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause)
60 if User.current.logged? 60 if User.current.logged?
61 @user_projects = User.current.projects 61 @user_projects = User.current.projects.sort_by(&:lft)
62 end 62 end
63 render :template => 'projects/index.rhtml', :layout => !request.xhr? 63 render :template => 'projects/index.rhtml', :layout => !request.xhr?
64 } 64 }
65 format.xml { 65 format.xml {
66 @projects = Project.visible.find(:all, :order => 'lft') 66 @projects = Project.visible.find(:all, :order => 'lft')