Commit 1e78ceea496a8e031d82e9531d2122287602dcb3
1 parent
a87f5c60
Exists in
master
and in
4 other branches
replace selectboxes with filters
Showing
3 changed files
with
55 additions
and
5 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/common.scss
app/helpers/labels_helper.rb
app/views/issues/_issues.html.haml
... | ... | @@ -14,9 +14,58 @@ |
14 | 14 | = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" |
15 | 15 | .issues_filters |
16 | 16 | = form_tag project_issues_path(@project), method: :get, remote: true do |
17 | - = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") | |
18 | - = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
19 | - = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
17 | + %span Filter by | |
18 | + .dropdown.inline.prepend-left-10 | |
19 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
20 | + %i.icon-tags | |
21 | + %span.light labels: | |
22 | + - if params[:label_name] | |
23 | + %strong= params[:label_name] | |
24 | + - else | |
25 | + Any | |
26 | + %b.caret | |
27 | + %ul.dropdown-menu | |
28 | + - issue_label_names.each do |label_name| | |
29 | + %li | |
30 | + = link_to '#' do | |
31 | + %span{class: "label #{label_css_class(label_name)}"} | |
32 | + %i.icon-tag | |
33 | + = label_name | |
34 | + .dropdown.inline.prepend-left-10 | |
35 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
36 | + %i.icon-user | |
37 | + %span.light assignee: | |
38 | + - if params[:assignee_id].present? | |
39 | + %strong= User.find(params[:assignee_id]).name | |
40 | + - else | |
41 | + Any | |
42 | + %b.caret | |
43 | + %ul.dropdown-menu | |
44 | + - @project.users.sort_by(&:name).each do |user| | |
45 | + %li | |
46 | + = link_to '#' do | |
47 | + = image_tag gravatar_icon(user.email), class: "avatar s16" | |
48 | + = user.name | |
49 | + | |
50 | + .dropdown.inline.prepend-left-10 | |
51 | + %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} | |
52 | + %i.icon-time | |
53 | + %span.light milestone: | |
54 | + - if params[:milestone_id].present? | |
55 | + %strong= Milestone.find(params[:milestone_id]).title | |
56 | + - else | |
57 | + Any | |
58 | + %b.caret | |
59 | + %ul.dropdown-menu | |
60 | + - issues_active_milestones.each do |milestone| | |
61 | + %li | |
62 | + = link_to '#' do | |
63 | + %strong= milestone.title | |
64 | + %small.light= milestone.expires_at | |
65 | + | |
66 | + -#= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") | |
67 | + -#= select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") | |
68 | + -#= select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") | |
20 | 69 | = hidden_field_tag :status, params[:status] |
21 | 70 | = hidden_field_tag :issue_search, params[:status], id: 'filter_issue_search' |
22 | 71 | ... | ... |