Mercurial > hg > soundsoftware-site
comparison app/controllers/projects_controller.rb @ 1209:1b1138f6f55e
Merge from branch live
author | Chris Cannam |
---|---|
date | Wed, 23 Jan 2013 13:11:25 +0000 |
parents | 91db8e091f10 |
children | 16826c3afbba |
comparison
equal
deleted
inserted
replaced
1078:b9e34a051f82 | 1209:1b1138f6f55e |
---|---|
56 @limit = per_page_option | 56 @limit = per_page_option |
57 @project_count = Project.visible_roots.count | 57 @project_count = Project.visible_roots.count |
58 @project_pages = Paginator.new self, @project_count, @limit, params['page'] | 58 @project_pages = Paginator.new self, @project_count, @limit, params['page'] |
59 @offset ||= @project_pages.current.offset | 59 @offset ||= @project_pages.current.offset |
60 @projects = Project.visible_roots.all(:offset => @offset, :limit => @limit, :order => sort_clause) | 60 @projects = Project.visible_roots.all(:offset => @offset, :limit => @limit, :order => sort_clause) |
61 if User.current.logged? | |
62 # seems sort_by gives us case-sensitive ordering, which we don't want | |
63 # @user_projects = User.current.projects.sort_by(&:name) | |
64 @user_projects = User.current.projects.all(:order => :name) | |
65 end | |
66 render :template => 'projects/index.html.erb', :layout => !request.xhr? | 61 render :template => 'projects/index.html.erb', :layout => !request.xhr? |
67 } | 62 } |
68 format.api { | 63 format.api { |
69 @offset, @limit = api_offset_and_limit | 64 @offset, @limit = api_offset_and_limit |
70 @project_count = Project.visible.count | 65 @project_count = Project.visible.count |