Fix 500 when search for gitlab projects

This commit is contained in:
Dmitriy Zaporozhets 2015-09-11 19:59:39 +02:00
parent 2b683807b5
commit 15eeae5fa8
4 changed files with 7 additions and 12 deletions

View file

@ -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()

View file

@ -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

View file

@ -1,10 +1,5 @@
- if current_user
= content_for :title do
%h3.project-title
Dashboard
.pull-right
= render "search"
.projects
%p.fetch-status.light
%i.fa.fa-refresh.fa-spin

View file

@ -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