diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2016-03-11 17:13:09 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2016-03-11 17:13:09 +0000 |
commit | 3ed8a8e52cc0df6ee085bd545dc3061f240d7826 (patch) | |
tree | cbdb88046d6e43f48252d66a66d58bebfadf4ab8 | |
parent | 6bc7fad8ea2ace62157797e0c884ba36a5545152 (diff) | |
parent | 9f8661987db44f6c1d2cfd75c889344fc49bd6bc (diff) | |
download | gitlab-ce-3ed8a8e52cc0df6ee085bd545dc3061f240d7826.tar.gz |
Merge branch 'search-results-filter-dropdown' into 'master'
Improved search results filter dropdown
## Current
Currently filter dropdowns on search results page can be **very** long and off the page
![Screen_Shot_2016-03-11_at_15.25.24](/uploads/3418b0a6f4f8a0a8bd2441b53502c574/Screen_Shot_2016-03-11_at_15.25.24.png)
## New
Changed over to the new dropdown
![Screen_Shot_2016-03-11_at_15.29.06](/uploads/2d3a4a9b3e50f3e0fc1748a026cd5905/Screen_Shot_2016-03-11_at_15.29.06.png)
See merge request !3183
-rw-r--r-- | app/assets/stylesheets/framework/dropdowns.scss | 2 | ||||
-rw-r--r-- | app/views/search/_filter.html.haml | 46 |
2 files changed, 31 insertions, 17 deletions
diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 009d621fc74..5b647fc6176 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -294,7 +294,7 @@ } .dropdown-content { - max-height: 200px; + max-height: 215px; overflow-y: scroll; } diff --git a/app/views/search/_filter.html.haml b/app/views/search/_filter.html.haml index ec478a5963d..4ef544136a8 100644 --- a/app/views/search/_filter.html.haml +++ b/app/views/search/_filter.html.haml @@ -6,14 +6,21 @@ - else Any %b.caret - %ul.dropdown-menu - %li - = link_to search_filter_path(group_id: nil) do - Any - - current_user.authorized_groups.sort_by(&:name).each do |group| - %li - = link_to search_filter_path(group_id: group.id, project_id: nil) do - = group.name + .dropdown-menu.dropdown-select.dropdown-menu-selectable + .dropdown-title + %span Filter results by group + %button.dropdown-title-button.dropdown-menu-close{aria: {label: "Close"}} + = icon('times') + .dropdown-content + %ul + %li + = link_to search_filter_path(group_id: nil), class: ("is-active" if !params[:group_id].present?) do + Any + %li.divider + - current_user.authorized_groups.sort_by(&:name).each do |group| + %li + = link_to search_filter_path(group_id: group.id, project_id: nil), class: ("is-active" if params[:group_id] == group.id.to_s) do + = group.name .dropdown.inline.prepend-left-10.project-filter %button.dropdown-toggle.btn.btn-sm{type: 'button', 'data-toggle' => 'dropdown'} @@ -23,11 +30,18 @@ - else Any %b.caret - %ul.dropdown-menu - %li - = link_to search_filter_path(project_id: nil) do - Any - - current_user.authorized_projects.sort_by(&:name_with_namespace).each do |project| - %li - = link_to search_filter_path(project_id: project.id, group_id: nil) do - = project.name_with_namespace + .dropdown-menu.dropdown-select.dropdown-menu-selectable + .dropdown-title + %span Filter results by project + %button.dropdown-title-button.dropdown-menu-close{aria: {label: "Close"}} + = icon('times') + .dropdown-content + %ul + %li + = link_to search_filter_path(project_id: nil), class: ("is-active" if !params[:project_id].present?) do + Any + %li.divider + - current_user.authorized_projects.sort_by(&:name_with_namespace).each do |project| + %li + = link_to search_filter_path(project_id: project.id, group_id: nil), class: ("is-active" if params[:project_id] == project.id.to_s) do + = project.name_with_namespace |