Commit 188a74c3a2e16329eae9abc0006830dbfdea0472
1 parent
1e78ceea
Exists in
master
and in
4 other branches
init filter links
Showing
2 changed files
with
15 additions
and
4 deletions
Show diff stats
app/helpers/issues_helper.rb
... | ... | @@ -78,4 +78,15 @@ module IssuesHelper |
78 | 78 | "" |
79 | 79 | end |
80 | 80 | end |
81 | + | |
82 | + def project_issues_with_filter_path(project, opts) | |
83 | + default_opts = { | |
84 | + status: params[:status], | |
85 | + label_name: params[:label_name], | |
86 | + milestone_id: params[:milestone_id], | |
87 | + assignee_id: params[:assignee_id], | |
88 | + } | |
89 | + | |
90 | + project_issues_path(@project, default_opts.merge(opts)) | |
91 | + end | |
81 | 92 | end | ... | ... |
app/views/issues/_issues.html.haml
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | %a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"} |
20 | 20 | %i.icon-tags |
21 | 21 | %span.light labels: |
22 | - - if params[:label_name] | |
22 | + - if params[:label_name].present? | |
23 | 23 | %strong= params[:label_name] |
24 | 24 | - else |
25 | 25 | Any |
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | %ul.dropdown-menu |
28 | 28 | - issue_label_names.each do |label_name| |
29 | 29 | %li |
30 | - = link_to '#' do | |
30 | + = link_to project_issues_with_filter_path(@project, label_name: label_name) do | |
31 | 31 | %span{class: "label #{label_css_class(label_name)}"} |
32 | 32 | %i.icon-tag |
33 | 33 | = label_name |
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | %ul.dropdown-menu |
44 | 44 | - @project.users.sort_by(&:name).each do |user| |
45 | 45 | %li |
46 | - = link_to '#' do | |
46 | + = link_to project_issues_with_filter_path(@project, assignee_id: user.id) do | |
47 | 47 | = image_tag gravatar_icon(user.email), class: "avatar s16" |
48 | 48 | = user.name |
49 | 49 | |
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | %ul.dropdown-menu |
60 | 60 | - issues_active_milestones.each do |milestone| |
61 | 61 | %li |
62 | - = link_to '#' do | |
62 | + = link_to project_issues_with_filter_path(@project, milestone_id: milestone.id) do | |
63 | 63 | %strong= milestone.title |
64 | 64 | %small.light= milestone.expires_at |
65 | 65 | ... | ... |