Mercurial > hg > soundsoftware-site
comparison app/controllers/projects_controller.rb @ 150:857ac9ccf613 luisf
Merge from branch "live"
author | Chris Cannam |
---|---|
date | Mon, 24 Jan 2011 14:18:00 +0000 |
parents | 1890a968b404 |
children | 05f9a2a9c753 c09865a48f4e |
comparison
equal
deleted
inserted
replaced
143:0460c75392bc | 150:857ac9ccf613 |
---|---|
43 helper :queries | 43 helper :queries |
44 include QueriesHelper | 44 include QueriesHelper |
45 helper :repositories | 45 helper :repositories |
46 include RepositoriesHelper | 46 include RepositoriesHelper |
47 include ProjectsHelper | 47 include ProjectsHelper |
48 | 48 |
49 # Lists visible projects | 49 # Lists visible projects |
50 def index | 50 def index |
51 respond_to do |format| | 51 respond_to do |format| |
52 format.html { | 52 format.html { |
53 @projects = Project.visible.find(:all, :order => 'lft') | 53 sort_init 'lft' |
54 sort_update %w(lft title created_on updated_on) | |
55 @limit = per_page_option | |
56 @project_count = Project.visible.count | |
57 @project_pages = Paginator.new self, @project_count, @limit, params['page'] | |
58 @offset ||= @project_pages.current.offset | |
59 @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause) | |
60 if User.current.logged? | |
61 @user_projects = User.current.projects.sort_by(&:lft) | |
62 end | |
63 render :template => 'projects/index.rhtml', :layout => !request.xhr? | |
54 } | 64 } |
55 format.xml { | 65 format.xml { |
56 @projects = Project.visible.find(:all, :order => 'lft') | 66 @projects = Project.visible.find(:all, :order => 'lft') |
57 } | 67 } |
58 format.atom { | 68 format.atom { |