Commit feee3838 authored by Robert Speicher's avatar Robert Speicher

Combine unassigned_issue and unassigned_milestone into unassigned_filter

parent 5a90d044
...@@ -37,13 +37,10 @@ module IssuesHelper ...@@ -37,13 +37,10 @@ module IssuesHelper
@project.issues.tag_counts_on(:labels).map(&:name) @project.issues.tag_counts_on(:labels).map(&:name)
end end
# Returns a fake Milestone-like object that can be used in a # Returns an OpenStruct object suitable for use by <tt>options_from_collection_for_select</tt>
# <tt>select_tag</tt> to allow filtering by issues with no assigned milestone # to allow filtering issues by an unassigned User or Milestone
def unassigned_milestone def unassigned_filter
OpenStruct.new(id: 0, title: 'Unspecified') # Milestone uses :title, Issue uses :name
end OpenStruct.new(id: 0, title: 'Unspecified', name: 'Unassigned')
def unassigned_issue
OpenStruct.new(id: 0, name: 'Unassigned')
end end
end end
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
.right .right
= form_tag project_issues_path(@project), method: :get, class: :right do = form_tag project_issues_path(@project), method: :get, class: :right do
= select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels")
= select_tag(:assignee_id, options_from_collection_for_select([unassigned_issue] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee") = select_tag(:assignee_id, options_from_collection_for_select([unassigned_filter] + @project.users.all, "id", "name", params[:assignee_id]), prompt: "Assignee")
= select_tag(:milestone_id, options_from_collection_for_select([unassigned_milestone] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone") = select_tag(:milestone_id, options_from_collection_for_select([unassigned_filter] + @project.milestones.order("id desc").all, "id", "title", params[:milestone_id]), prompt: "Milestone")
= hidden_field_tag :f, params[:f] = hidden_field_tag :f, params[:f]
.clearfix .clearfix
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment