BigW Consortium Gitlab

_dropdown.html.haml 1.8 KB
Newer Older
1
- @sort ||= sort_value_latest_activity
2
.dropdown.js-project-filter-dropdown-wrap
3 4
  - toggle_text = projects_sort_options_hash[@sort]
  = dropdown_toggle(toggle_text, { toggle: 'dropdown' }, { id: 'sort-projects-dropdown' })
5 6 7
  %ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
    %li.dropdown-header
      Sort by
8 9
    - projects_sort_options_hash.each do |value, title|
      %li
10
        = link_to filter_projects_path(sort: value), class: ("is-active" if @sort == value) do
11 12
          = title

13 14
    %li.divider
    %li
15
      = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do
16 17
        Hide archived projects
    %li
18
      = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do
19
        Show archived projects
20 21 22
    %li
      = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do
        Show archived projects only
23 24 25
    - if current_user
      %li.divider
      %li
26
        = link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do
27 28
          Owned by anyone
      %li
29
        = link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do
30
          Owned by me
31 32 33
      - if @group && @group.shared_projects.present?
        %li.divider
        %li
34
          = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do
35 36
            All projects
        %li
37
          = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do
38 39
            Hide shared projects
        %li
40
          = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do
41
            Hide group projects