2019-04-12 12:14:28 +00:00
|
|
|
- @sort ||= sort_value_latest_activity
|
2019-04-17 11:02:34 +00:00
|
|
|
- toggle_text = projects_sort_option_titles[@sort]
|
2019-04-19 08:36:16 +00:00
|
|
|
|
2019-04-12 15:11:46 +00:00
|
|
|
.btn-group.w-100{ role: "group" }
|
|
|
|
.btn-group.w-100.dropdown.js-project-filter-dropdown-wrap{ role: "group" }
|
2019-05-02 12:49:11 +00:00
|
|
|
%button#sort-projects-dropdown.btn.btn-default.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' } }
|
2019-04-12 12:14:28 +00:00
|
|
|
= toggle_text
|
2020-11-20 12:09:35 +00:00
|
|
|
= sprite_icon('chevron-down', css_class: 'dropdown-menu-toggle-icon gl-top-3')
|
2019-04-12 12:14:28 +00:00
|
|
|
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable
|
|
|
|
%li.dropdown-header
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Sort by")
|
2019-04-12 12:14:28 +00:00
|
|
|
- projects_sort_options_hash.each do |value, title|
|
|
|
|
%li
|
2019-04-19 08:36:16 +00:00
|
|
|
= link_to title, filter_projects_path(sort: value), class: ("is-active" if toggle_text == title)
|
2019-04-12 12:14:28 +00:00
|
|
|
|
|
|
|
%li.divider
|
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Hide archived projects")
|
2019-04-12 12:14:28 +00:00
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Show archived projects")
|
2019-04-12 12:14:28 +00:00
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Show archived projects only")
|
2019-04-19 08:36:16 +00:00
|
|
|
|
2019-04-12 12:14:28 +00:00
|
|
|
- if current_user && @group && @group.shared_projects.present?
|
|
|
|
%li.divider
|
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("All projects")
|
2019-04-12 12:14:28 +00:00
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Hide shared projects")
|
2019-04-12 12:14:28 +00:00
|
|
|
%li
|
|
|
|
= link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do
|
2019-04-17 11:02:34 +00:00
|
|
|
= _("Hide group projects")
|
2019-04-12 12:14:28 +00:00
|
|
|
|
|
|
|
= project_sort_direction_button(@sort)
|