summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard
diff options
context:
space:
mode:
authorJosh Frye <joshfng@gmail.com>2016-02-03 18:21:14 -0500
committerJosh Frye <joshfng@gmail.com>2016-02-04 13:03:41 -0500
commit2ad094132de3c491511261bf0e6a2e577fd699dd (patch)
tree7ba4cf6ed687cde58b13a0c4151ac243db09e47f /app/controllers/dashboard
parent2c871ca1968846871ed264cad34b50611eecae3b (diff)
downloadgitlab-ce-2ad094132de3c491511261bf0e6a2e577fd699dd.tar.gz
Various filter fixes
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r--app/controllers/dashboard/projects_controller.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb
index 2f56228ff75..cd3a25866af 100644
--- a/app/controllers/dashboard/projects_controller.rb
+++ b/app/controllers/dashboard/projects_controller.rb
@@ -24,7 +24,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
format.json do
render json: {
- html: view_to_html_string("dashboard/projects/projects", locals: { projects: @projects })
+ html: view_to_html_string("dashboard/projects/_projects", locals: { projects: @projects })
}
end
end
@@ -34,6 +34,13 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects = current_user.starred_projects
@projects = @projects.includes(:namespace, :forked_from_project, :tags)
@projects = @projects.sort(@sort = params[:sort])
+
+ terms = params['filter_projects']
+
+ if terms.present?
+ @projects = @projects.search(terms)
+ end
+
@projects = @projects.page(params[:page]).per(PER_PAGE)
@last_push = current_user.recent_push
@groups = []
@@ -42,8 +49,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
format.html
format.json do
- load_events
- pager_json("events/_events", @events.count)
+ render json: {
+ html: view_to_html_string("dashboard/projects/projects", locals: { projects: @projects })
+ }
end
end
end