diff options
Diffstat (limited to 'app/views/shared/projects/_dropdown.html.haml')
-rw-r--r-- | app/views/shared/projects/_dropdown.html.haml | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/app/views/shared/projects/_dropdown.html.haml b/app/views/shared/projects/_dropdown.html.haml index 98b258d9275..4cecfd16bc1 100644 --- a/app/views/shared/projects/_dropdown.html.haml +++ b/app/views/shared/projects/_dropdown.html.haml @@ -1,41 +1,46 @@ - @sort ||= sort_value_latest_activity -.dropdown.js-project-filter-dropdown-wrap - - toggle_text = projects_sort_options_hash[@sort] - = dropdown_toggle(toggle_text, { toggle: 'dropdown', display: 'static' }, { id: 'sort-projects-dropdown' }) - %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable - %li.dropdown-header - Sort by - - projects_sort_options_hash.each do |value, title| - %li - = link_to filter_projects_path(sort: value), class: ("is-active" if @sort == value) do - = title +.btn-group{ role: "group" } + .btn-group.dropdown.js-project-filter-dropdown-wrap.filter-with-icon{ role: "group" } + - toggle_text = projects_sort_option_titles[@sort] + %button.dropdown-menu-toggle{ id: 'sort-projects-dropdown', type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } + = toggle_text + = icon('chevron-down') + %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable + %li.dropdown-header + Sort by + - projects_sort_options_hash.each do |value, title| + %li + = link_to filter_projects_path(sort: value), class: ("is-active" if projects_sort_option_titles[@sort] == title) do + = title - %li.divider - %li - = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do - Hide archived projects - %li - = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do - Show archived projects - %li - = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do - Show archived projects only - - if current_user %li.divider %li - = link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do - Owned by anyone + = link_to filter_projects_path(archived: nil), class: ("is-active" unless params[:archived].present?) do + Hide archived projects + %li + = link_to filter_projects_path(archived: true), class: ("is-active" if Gitlab::Utils.to_boolean(params[:archived])) do + Show archived projects %li - = link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do - Owned by me - - if @group && @group.shared_projects.present? + = link_to filter_projects_path(archived: 'only'), class: ("is-active" if params[:archived] == 'only') do + Show archived projects only + - if current_user %li.divider %li - = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do - All projects + = link_to filter_projects_path(personal: nil), class: ("is-active" unless params[:personal].present?) do + Owned by anyone %li - = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do - Hide shared projects - %li - = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do - Hide group projects + = link_to filter_projects_path(personal: true), class: ("is-active" if params[:personal].present?) do + Owned by me + - if @group && @group.shared_projects.present? + %li.divider + %li + = link_to filter_projects_path(shared: nil), class: ("is-active" unless params[:shared].present?) do + All projects + %li + = link_to filter_projects_path(shared: 0), class: ("is-active" if params[:shared] == '0') do + Hide shared projects + %li + = link_to filter_projects_path(shared: 1), class: ("is-active" if params[:shared] == '1') do + Hide group projects + + = project_sort_direction_button(@sort) |