debian-mirror-gitlab/app/views/shared/groups/_dropdown.html.haml

34 lines
1.5 KiB
Text
Raw Normal View History

2018-03-17 18:26:18 +05:30
- options_hash = local_assigns.fetch(:options_hash, groups_sort_options_hash)
- show_archive_options = local_assigns.fetch(:show_archive_options, false)
- if @sort.present?
- default_sort_by = @sort
- else
- if params[:sort]
- default_sort_by = params[:sort]
- else
- default_sort_by = sort_value_recently_created
.dropdown.inline.js-group-filter-dropdown-wrap.append-right-10
2019-02-15 15:39:39 +05:30
%button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' }
2017-09-10 17:25:29 +05:30
%span.dropdown-label
2018-03-17 18:26:18 +05:30
= options_hash[default_sort_by]
2017-08-17 22:00:37 +05:30
= icon('chevron-down')
2018-11-08 19:23:39 +05:30
%ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable
2018-03-17 18:26:18 +05:30
%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 default_sort_by == value) do
= title
- if show_archive_options
%li.divider
%li.js-filter-archived-projects
2018-03-27 19:54:05 +05:30
= link_to filter_groups_path(archived: nil), class: ("is-active" unless params[:archived].present?) do
2019-07-31 22:56:46 +05:30
= _("Hide archived projects")
2018-03-17 18:26:18 +05:30
%li.js-filter-archived-projects
2018-03-27 19:54:05 +05:30
= link_to filter_groups_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do
2019-07-31 22:56:46 +05:30
= _("Show archived projects")
2018-03-17 18:26:18 +05:30
%li.js-filter-archived-projects
2018-03-27 19:54:05 +05:30
= link_to filter_groups_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do
2019-07-31 22:56:46 +05:30
= _("Show archived projects only")