2022-10-11 01:57:18 +05:30
|
|
|
- placeholder = local_assigns[:search_form_placeholder] ? search_form_placeholder : _('Filter by name')
|
2023-04-23 21:23:45 +05:30
|
|
|
- admin_view ||= false
|
|
|
|
- top_padding = admin_view ? 'gl-lg-pt-3' : ''
|
2019-07-31 22:56:46 +05:30
|
|
|
|
2023-06-20 00:43:36 +05:30
|
|
|
= form_tag filter_projects_path, method: :get, class: "project-filter-form gl-display-flex! gl-flex-wrap gl-w-full gl-gap-3 #{top_padding}", data: { qa_selector: 'project_filter_form_container' }, id: 'project-filter-form' do |f|
|
2017-08-17 22:00:37 +05:30
|
|
|
= search_field_tag :name, params[:name],
|
2019-07-31 22:56:46 +05:30
|
|
|
placeholder: placeholder,
|
2023-04-23 21:23:45 +05:30
|
|
|
class: "project-filter-form-field form-control input-short js-projects-list-filter gl-m-0!",
|
2017-08-17 22:00:37 +05:30
|
|
|
spellcheck: false,
|
|
|
|
id: 'project-filter-form-field',
|
|
|
|
autofocus: local_assigns[:autofocus]
|
|
|
|
|
|
|
|
- if local_assigns[:icon]
|
2021-01-03 14:25:43 +05:30
|
|
|
= sprite_icon('search', css_class: 'search-icon')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
- 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]
|
2018-12-13 13:39:08 +05:30
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
- if params[:language].present?
|
|
|
|
= hidden_field_tag :language, params[:language]
|
|
|
|
|
2023-04-23 21:23:45 +05:30
|
|
|
.dropdown{ class: 'gl-m-0!' }
|
|
|
|
= dropdown_toggle(search_language_placeholder, { toggle: 'dropdown', testid: 'project-language-dropdown' })
|
|
|
|
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable
|
|
|
|
%li
|
|
|
|
= link_to _('Any'), filter_projects_path(language: nil, name: nil)
|
|
|
|
- programming_languages.each do |language|
|
2023-03-04 22:38:38 +05:30
|
|
|
%li
|
2023-04-23 21:23:45 +05:30
|
|
|
= link_to filter_projects_path(language: language.id, name: nil), class: language_state_class(language) do
|
|
|
|
= language.name
|
2023-03-04 22:38:38 +05:30
|
|
|
|
|
|
|
= submit_tag nil, class: 'gl-display-none!'
|
|
|
|
|
|
|
|
= render 'shared/projects/dropdown'
|
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
= render_if_exists 'shared/projects/search_fields'
|
2023-04-23 21:23:45 +05:30
|
|
|
|
|
|
|
- if admin_view
|
|
|
|
- if params[:namespace_id].present?
|
|
|
|
- namespace = Namespace.find(params[:namespace_id])
|
|
|
|
- selected_text = "#{namespace.kind}: #{namespace.full_path}" if namespace
|
|
|
|
.gl-display-flex.gl-w-full.gl-md-w-auto{ class: 'gl-m-0!' }
|
|
|
|
.js-namespace-select{ data: { field_name: 'namespace_id', selected_id: namespace&.id, selected_text: selected_text, update_location: 'true' } }
|
|
|
|
|
|
|
|
= link_to new_project_path, class: 'gl-button btn btn-confirm gl-display-inline gl-mb-0!' do
|
|
|
|
= _('New Project')
|