summaryrefslogtreecommitdiff
path: root/app/views/shared/groups/_dropdown.html.haml
blob: 75c34102935dbbd6eb199d0f56696587af9f8e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
- options_hash = local_assigns.fetch(:options_hash, groups_sort_options_hash)
- show_archive_options = local_assigns.fetch(:show_archive_options, false)

.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")