|
|
|
@ -19,6 +19,9 @@ class ProjectsController < ApplicationController
|
|
|
|
|
menu_item :overview
|
|
|
|
|
menu_item :roadmap, :only => :roadmap
|
|
|
|
|
menu_item :settings, :only => :settings
|
|
|
|
|
menu_item l(:label_sort_by_time), :only => :index
|
|
|
|
|
menu_item l(:label_sort_by_active), :only => :index
|
|
|
|
|
menu_item l(:label_sort_by_influence), :only => :index
|
|
|
|
|
|
|
|
|
|
before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ]
|
|
|
|
|
before_filter :authorize, :except => [:watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback, :project_respond]
|
|
|
|
@ -104,6 +107,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
@project_pages = Paginator.new @project_count, @limit, params['page']
|
|
|
|
|
|
|
|
|
|
@offset ||= @project_pages.reverse_offset
|
|
|
|
|
|
|
|
|
|
#@projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all
|
|
|
|
|
if params[:project_sort_type].present?
|
|
|
|
|
case params[:project_sort_type]
|
|
|
|
@ -118,6 +122,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
@projects = @projects.offset(@offset).limit(limit).all.reverse
|
|
|
|
|
end
|
|
|
|
|
@s_type = 0
|
|
|
|
|
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
|
|
|
|
# @projects = @projects[@offset, @limit]
|
|
|
|
|
when '1'
|
|
|
|
@ -131,6 +136,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
@projects = @projects.includes(:project_status).reorder('project_statuses.changesets_count').offset(@offset).limit(limit).all.reverse
|
|
|
|
|
end
|
|
|
|
|
@s_type = 1
|
|
|
|
|
|
|
|
|
|
#@projects = @projects[@offset, @limit]
|
|
|
|
|
when '2'
|
|
|
|
@ -144,6 +150,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
@projects = @projects.includes(:project_status).reorder('project_statuses.watchers_count').offset(@offset).limit(limit).all.reverse
|
|
|
|
|
end
|
|
|
|
|
@s_type = 2
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
@offset ||= @project_pages.reverse_offset
|
|
|
|
@ -156,6 +163,7 @@ class ProjectsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
@projects = @projects.offset(@offset).limit(limit).all.reverse
|
|
|
|
|
end
|
|
|
|
|
@s_type = 0
|
|
|
|
|
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
|
|
|
|
|
# @projects = @projects[@offset, @limit]
|
|
|
|
|
|
|
|
|
|