BigW Consortium Gitlab

Commit 15eeae5f by Dmitriy Zaporozhets

Fix 500 when search for gitlab projects

parent 2b683807
......@@ -16,7 +16,7 @@
complete: =>
$(".loading").hide()
success: (data) =>
Pager.append(data.count, data.html)
CiPager.append(data.count, data.html)
dataType: "json"
append: (count, html) ->
......@@ -34,9 +34,9 @@
fireDelay: 1000
fireOnce: true
ceaseFire: ->
Pager.disable
CiPager.disable
callback: (i) =>
unless $(".loading").is(':visible')
$(".loading").show()
Pager.getItems()
CiPager.getItems()
......@@ -22,7 +22,7 @@ module Ci
@page = @offset == 0 ? 1 : (@offset / @limit + 1)
@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)
@projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date
......
- if current_user
= content_for :title do
%h3.project-title
Dashboard
.pull-right
= render "search"
= render "search"
.projects
%p.fetch-status.light
%i.fa.fa-refresh.fa-spin
......@@ -12,6 +7,6 @@
$.get '#{gitlab_ci_projects_path}', (data) ->
$(".projects").html data.html
CiPager.init "#{gitlab_ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false
- else
= render 'public'
......@@ -2,7 +2,7 @@
%html{ lang: "en"}
= render 'layouts/head'
%body{class: "ci-body #{user_application_theme}", 'data-page' => body_data_page}
- header_title = "Projects"
- header_title = "CI Projects"
- if current_user
= render "layouts/header/default", title: header_title
- 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