5bb6a85b90
Reuse same search form and behavior for dashboard#projects, group#projects and admin#projects. Repsect all other options like sorting, personal filter when search projects by name. Create FilterableList JS class to handle identical behaviour of projects and groups lists. This change also makes filtering and sorting availabe on explore#projects and explore#groups no matter if you are logged in or not. Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
23 lines
832 B
Text
23 lines
832 B
Text
= form_tag filter_projects_path, method: :get, class: 'project-filter-form', id: 'project-filter-form' do |f|
|
|
= search_field_tag :name, params[:name],
|
|
placeholder: 'Filter by name...',
|
|
class: 'project-filter-form-field form-control input-short js-projects-list-filter',
|
|
spellcheck: false,
|
|
id: 'project-filter-form-field',
|
|
tabindex: "2",
|
|
autofocus: local_assigns[:autofocus]
|
|
|
|
- if local_assigns[:icon]
|
|
= icon("search", class: "search-icon")
|
|
|
|
- if params[:sort].present?
|
|
= hidden_field_tag :sort, params[:sort]
|
|
|
|
- if params[:personal].present?
|
|
= hidden_field_tag :personal, params[:personal]
|
|
|
|
- if params[:archived].present?
|
|
= hidden_field_tag :archived, params[:archived]
|
|
|
|
- if params[:visibility_level].present?
|
|
= hidden_field_tag :visibility_level, params[:visibility_level]
|