diff options
Diffstat (limited to 'app/views/shared/groups')
-rw-r--r-- | app/views/shared/groups/_dropdown.html.haml | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/app/views/shared/groups/_dropdown.html.haml b/app/views/shared/groups/_dropdown.html.haml index 75c34102935..80edce8e7c4 100644 --- a/app/views/shared/groups/_dropdown.html.haml +++ b/app/views/shared/groups/_dropdown.html.haml @@ -1,26 +1,5 @@ - options_hash = local_assigns.fetch(:options_hash, groups_sort_options_hash) -- show_archive_options = local_assigns.fetch(:show_archive_options, false) +- groups_sort_options = options_hash.map { |value, title| { value: value, text: title, href: filter_groups_path(sort: value) } } -.dropdown.inline.js-group-filter-dropdown-wrap.gl-mr-3 - %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } - %span.dropdown-label - = options_hash[project_list_sort_by] - = sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3') - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable - %li.dropdown-header - = _("Sort by") - - options_hash.each do |value, title| - %li.js-filter-sort-order - = link_to filter_groups_path(sort: value), class: ("is-active" if project_list_sort_by == value) do - = title - - if show_archive_options - %li.divider - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - = _("Hide archived projects") - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - = _("Show archived projects") - %li.js-filter-archived-projects - = link_to filter_groups_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - = _("Show archived projects only") +%div{ data: { testid: 'group_sort_by_dropdown' } } + = gl_redirect_listbox_tag groups_sort_options, project_list_sort_by, data: { right: true } |