Commit 15eeae5f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix 500 when search for gitlab projects

parent 2b683807
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
complete: => complete: =>
$(".loading").hide() $(".loading").hide()
success: (data) => success: (data) =>
Pager.append(data.count, data.html) CiPager.append(data.count, data.html)
dataType: "json" dataType: "json"
append: (count, html) -> append: (count, html) ->
...@@ -34,9 +34,9 @@ ...@@ -34,9 +34,9 @@
fireDelay: 1000 fireDelay: 1000
fireOnce: true fireOnce: true
ceaseFire: -> ceaseFire: ->
Pager.disable CiPager.disable
callback: (i) => callback: (i) =>
unless $(".loading").is(':visible') unless $(".loading").is(':visible')
$(".loading").show() $(".loading").show()
Pager.getItems() CiPager.getItems()
...@@ -22,7 +22,7 @@ module Ci ...@@ -22,7 +22,7 @@ module Ci
@page = @offset == 0 ? 1 : (@offset / @limit + 1) @page = @offset == 0 ? 1 : (@offset / @limit + 1)
@gl_projects = current_user.authorized_projects @gl_projects = current_user.authorized_projects
@gl_projects = @gl_projects.where("name LIKE %?%", params[:search]) if params[:search] @gl_projects = @gl_projects.where("name LIKE ?", "%#{params[:search]}%") if params[:search]
@gl_projects = @gl_projects.page(@page).per(@limit) @gl_projects = @gl_projects.page(@page).per(@limit)
@projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date @projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date
......
- if current_user - if current_user
= content_for :title do
%h3.project-title
Dashboard
.pull-right
= render "search" = render "search"
.projects .projects
%p.fetch-status.light %p.fetch-status.light
%i.fa.fa-refresh.fa-spin %i.fa.fa-refresh.fa-spin
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
%html{ lang: "en"} %html{ lang: "en"}
= render 'layouts/head' = render 'layouts/head'
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page} %body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page}
- header_title = "Projects" - header_title = "CI Projects"
- if current_user - if current_user
= render "layouts/header/default", title: header_title = render "layouts/header/default", title: header_title
- else - else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment