Pagination and better perfomance for projects page.
This commit is contained in:
parent
60bf502bf1
commit
1d601616a3
6 changed files with 42 additions and 19 deletions
|
@ -43,8 +43,8 @@ class CommitsController < ApplicationController
|
|||
end
|
||||
|
||||
def compare
|
||||
first = project.commit(params[:to])
|
||||
last = project.commit(params[:from])
|
||||
first = project.commit(params[:to].try(:strip))
|
||||
last = project.commit(params[:from].try(:strip))
|
||||
|
||||
@diffs = []
|
||||
@commits = []
|
||||
|
|
|
@ -11,9 +11,9 @@ class ProjectsController < ApplicationController
|
|||
before_filter :require_non_empty_project, :only => [:blob, :tree, :graph]
|
||||
|
||||
def index
|
||||
@projects = current_user.projects
|
||||
@projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse
|
||||
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20)
|
||||
@projects = current_user.projects.includes(:events).order("events.created_at DESC")
|
||||
@projects = @projects.page(params[:page]).per(40)
|
||||
@events = Event.where(:project_id => current_user.projects.map(&:id)).recent.limit(20)
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue