Add simple search to projects in public area
This commit is contained in:
parent
50d4420237
commit
c5feabde2d
|
@ -7,6 +7,7 @@ class Public::ProjectsController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@projects = Project.public_only
|
@projects = Project.public_only
|
||||||
|
@projects = @projects.search(params[:search]) if params[:search].present?
|
||||||
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
|
@projects = @projects.includes(:namespace).order("namespaces.path, projects.name ASC").page(params[:page]).per(20)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,16 @@
|
||||||
%h3.page_title
|
.row
|
||||||
|
.span6
|
||||||
|
%h3.page_title
|
||||||
Projects (#{@projects.total_count})
|
Projects (#{@projects.total_count})
|
||||||
%small with read-only access
|
%small with read-only access
|
||||||
|
.span6
|
||||||
|
.pull-right
|
||||||
|
= form_tag public_projects_path, method: :get, class: 'form-inline' do |f|
|
||||||
|
.search-holder
|
||||||
|
.input
|
||||||
|
= search_field_tag :search, params[:search], placeholder: "gitlab-ci", class: "span3 search-text-input", id: "projects_search"
|
||||||
|
= submit_tag 'Search', class: "btn btn-primary wide"
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
|
|
||||||
.public-projects
|
.public-projects
|
||||||
|
|
Loading…
Reference in New Issue