Fix 500 when search for gitlab projects
This commit is contained in:
parent
2b683807b5
commit
15eeae5fa8
4 changed files with 7 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
- 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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue