Dashboard perfomance improved. Filter for projects page
This commit is contained in:
parent
6d5c969872
commit
cff9519127
16 changed files with 215 additions and 112 deletions
|
@ -11,9 +11,10 @@ class ProjectsController < ApplicationController
|
|||
before_filter :require_non_empty_project, :only => [:blob, :tree, :graph]
|
||||
|
||||
def index
|
||||
source = current_user.projects
|
||||
source = source.tagged_with(params[:tag]) unless params[:tag].blank?
|
||||
@projects = source.all
|
||||
@limit, @offset = (params[:limit] || 16), (params[:offset] || 0)
|
||||
@projects = current_user.projects
|
||||
@projects = @projects.where("name LIKE ?", "%#{params[:terms]}%") unless params[:terms].blank?
|
||||
@projects = @projects.limit(@limit).offset(@offset)
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue