BigW Consortium Gitlab

_dropdown.html.haml 1.41 KB
Newer Older
1
- @sort ||= sort_value_recently_updated
2
- personal = params[:personal]
3
- archived = params[:archived]
4
- namespace_id = params[:namespace_id]
5
.dropdown.inline
6 7
  - toggle_text = projects_sort_options_hash[@sort]
  = dropdown_toggle(toggle_text, { toggle: 'dropdown' }, { id: 'sort-projects-dropdown' })
8 9 10
  %ul.dropdown-menu.dropdown-menu-align-right.dropdown-menu-selectable
    %li.dropdown-header
      Sort by
11 12
    - projects_sort_options_hash.each do |value, title|
      %li
13
        = link_to filter_projects_path(namespace_id: namespace_id, sort: value, archived: archived, personal: personal), class: ("is-active" if @sort == value) do
14 15
          = title

16 17
    %li.divider
    %li
18
      = link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, archived: nil), class: ("is-active" unless params[:archived].present?) do
19 20
        Hide archived projects
    %li
21
      = link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, archived: true), class: ("is-active" if params[:archived].present?) do
22
        Show archived projects
23 24 25
    - if current_user
      %li.divider
      %li
26
        = link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, personal: nil), class: ("is-active" unless personal.present?) do
27 28
          Owned by anyone
      %li
29
        = link_to filter_projects_path(namespace_id: namespace_id, sort: @sort, personal: true), class: ("is-active" if personal.present?) do
30
          Owned by me