Skip to content

Commit

Permalink
init filter links
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed May 8, 2013
1 parent 1e78cee commit 188a74c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions app/helpers/issues_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,15 @@ def title_for_issue(issue_id)
""
end
end

def project_issues_with_filter_path(project, opts)
default_opts = {
status: params[:status],
label_name: params[:label_name],
milestone_id: params[:milestone_id],
assignee_id: params[:assignee_id],
}

project_issues_path(@project, default_opts.merge(opts))
end
end
8 changes: 4 additions & 4 deletions app/views/issues/_issues.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
%a.dropdown-toggle.btn.btn-small{href: '#', "data-toggle" => "dropdown"}
%i.icon-tags
%span.light labels:
- if params[:label_name]
- if params[:label_name].present?
%strong= params[:label_name]
- else
Any
%b.caret
%ul.dropdown-menu
- issue_label_names.each do |label_name|
%li
= link_to '#' do
= link_to project_issues_with_filter_path(@project, label_name: label_name) do
%span{class: "label #{label_css_class(label_name)}"}
%i.icon-tag
= label_name
Expand All @@ -43,7 +43,7 @@
%ul.dropdown-menu
- @project.users.sort_by(&:name).each do |user|
%li
= link_to '#' do
= link_to project_issues_with_filter_path(@project, assignee_id: user.id) do
= image_tag gravatar_icon(user.email), class: "avatar s16"
= user.name

Expand All @@ -59,7 +59,7 @@
%ul.dropdown-menu
- issues_active_milestones.each do |milestone|
%li
= link_to '#' do
= link_to project_issues_with_filter_path(@project, milestone_id: milestone.id) do
%strong= milestone.title
%small.light= milestone.expires_at

Expand Down

0 comments on commit 188a74c

Please sign in to comment.