MR feedback

This commit is contained in:
Josh Frye 2016-02-08 20:34:54 -05:00
parent 8b4e9720d9
commit 120dca0f35
5 changed files with 9 additions and 12 deletions

View File

@ -1,24 +1,21 @@
class @ProjectsList
constructor: ->
$("#project-filter-form-field").off('keyup')
$(".projects-list .js-expand").on 'click', (e) ->
e.preventDefault()
list = $(this).closest('.projects-list')
$("#filter_projects").on 'keyup', ->
ProjectsList.filter_results($("#filter_projects"))
$("#project-filter-form-field").on 'keyup', ->
ProjectsList.filter_results($("#project-filter-form-field"))
@filter_results: ($element) ->
terms = $element.val()
filterSelector = $element.data('filter-selector') || 'span.filter-title'
if not terms
$("ul.projects-list li").show()
$(".projects-list li").show()
$('.gl-pagination').show()
else
$("ul.projects-list li").each (index) ->
$(".projects-list li").each (index) ->
$this = $(this)
name = $this.find(filterSelector).text()

View File

@ -12,7 +12,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects = @projects.search(terms)
end
@projects = @projects.page(params[:page]).per(PER_PAGE) if !terms.present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if terms.blank?
@last_push = current_user.recent_push
respond_to do |format|
@ -41,7 +41,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
@projects = @projects.search(terms)
end
@projects = @projects.page(params[:page]).per(PER_PAGE) if !terms.present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if terms.blank?
@last_push = current_user.recent_push
@groups = []

View File

@ -8,7 +8,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects = @projects.search(params[:search]) if params[:search].present?
@projects = @projects.search(params[:filter_projects]) if params[:filter_projects].present?
@projects = @projects.sort(@sort = params[:sort])
@projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE) if !params[:filter_projects].present?
@projects = @projects.includes(:namespace).page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank?
respond_to do |format|
format.html
@ -24,7 +24,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects = TrendingProjectsFinder.new.execute(current_user)
@projects = @projects.non_archived
@projects = @projects.search(params[:filter_projects]) if params[:filter_projects].present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if !params[:filter_projects].present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank?
respond_to do |format|
format.html
@ -40,7 +40,7 @@ class Explore::ProjectsController < Explore::ApplicationController
@projects = ProjectsFinder.new.execute(current_user)
@projects = @projects.search(params[:filter_projects]) if params[:filter_projects].present?
@projects = @projects.reorder('star_count DESC')
@projects = @projects.page(params[:page]).per(PER_PAGE) if !params[:filter_projects].present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank?
respond_to do |format|
format.html

View File

@ -42,7 +42,7 @@ class GroupsController < Groups::ApplicationController
@last_push = current_user.recent_push if current_user
@projects = @projects.includes(:namespace)
@projects = @projects.search(params[:filter_projects]) if params[:filter_projects].present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if !params[:filter_projects].present?
@projects = @projects.page(params[:page]).per(PER_PAGE) if params[:filter_projects].blank?
respond_to do |format|
format.html

View File

@ -47,7 +47,7 @@
= render 'shared/event_filter'
.content_list{:"data-href" => events_group_path}
.content_list{data: {href: events_group_path}}
= spinner
.tab-pane#projects