Commit e84df44ea033dcab315ca2f28186066ae6486ee6
1 parent
4673c853
Exists in
master
and in
4 other branches
Redesign search filters
Showing
1 changed file
with
10 additions
and
18 deletions
Show diff stats
app/views/search/_filter.html.haml
1 | 1 | %fieldset |
2 | 2 | %legend Groups: |
3 | - %ul.nav.nav-pills.nav-stacked | |
4 | - %li{class: ("active" if params[:group_id].blank?)} | |
5 | - = link_to search_path(group_id: nil, search: params[:search]) do | |
6 | - Any | |
7 | - - current_user.authorized_groups.each do |group| | |
8 | - %li{class: ("active" if params[:group_id] == group.id.to_s)} | |
9 | - = link_to search_path(group_id: group.id, search: params[:search]) do | |
10 | - = group.name | |
3 | + .clearfix | |
4 | + = select_tag 'group_id', options_from_collection_for_select(current_user.authorized_groups, :id, :name, params[:group_id]), prompt: 'All', include_blank: true, class: 'trigger-submit chosen' | |
5 | + | |
6 | + | |
7 | +%fieldset | |
8 | + %legend Teams: | |
9 | + .clearfix | |
10 | + = select_tag 'team_id', options_from_collection_for_select(current_user.authorized_teams, :id, :name, params[:team_id]), prompt: 'All', include_blank: true, class: 'trigger-submit chosen' | |
11 | 11 | |
12 | 12 | %fieldset |
13 | 13 | %legend Projects: |
14 | - %ul.nav.nav-pills.nav-stacked | |
15 | - %li{class: ("active" if params[:project_id].blank?)} | |
16 | - = link_to search_path(project_id: nil, search: params[:search]) do | |
17 | - Any | |
18 | - - current_user.authorized_projects.each do |project| | |
19 | - %li{class: ("active" if params[:project_id] == project.id.to_s)} | |
20 | - = link_to search_path(project_id: project.id, search: params[:search]) do | |
21 | - = project.name_with_namespace | |
14 | + .clearfix | |
15 | + = select_tag 'project_id', options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace, params[:project_id]), prompt: 'All', include_blank: true, class: 'trigger-submit chosen' | |
22 | 16 | |
23 | -= hidden_field_tag :group_id, params[:group_id] | |
24 | -= hidden_field_tag :project_id, params[:project_id] | ... | ... |