Commit 11aa7b00251d8fd29bb7f8c5a6176eb9713ff3ae
1 parent
75f0ff2c
Exists in
master
and in
4 other branches
Added ability to clear milestone/assignee during bulk update
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
app/helpers/issues_helper.rb
@@ -68,4 +68,12 @@ module IssuesHelper | @@ -68,4 +68,12 @@ module IssuesHelper | ||
68 | false | 68 | false |
69 | end | 69 | end |
70 | end | 70 | end |
71 | + | ||
72 | + def bulk_update_milestone_options | ||
73 | + options_for_select(["None (backlog)", nil]) + options_from_collection_for_select(project_active_milestones, "id", "title", params[:milestone_id]) | ||
74 | + end | ||
75 | + | ||
76 | + def bulk_update_assignee_options | ||
77 | + options_for_select(["None (unassigned)", nil]) + options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]) | ||
78 | + end | ||
71 | end | 79 | end |
app/views/projects/issues/_issues.html.haml
@@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
6 | = form_tag bulk_update_project_issues_path(@project), method: :post do | 6 | = form_tag bulk_update_project_issues_path(@project), method: :post do |
7 | %span Update selected issues with | 7 | %span Update selected issues with |
8 | = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") | 8 | = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") |
9 | - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]), prompt: "Assignee") | ||
10 | - = select_tag('update[milestone_id]', options_from_collection_for_select(project_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") | 9 | + = select_tag('update[assignee_id]', bulk_update_assignee_options, prompt: "Assignee") |
10 | + = select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone") | ||
11 | = hidden_field_tag 'update[issues_ids]', [] | 11 | = hidden_field_tag 'update[issues_ids]', [] |
12 | = hidden_field_tag :status, params[:status] | 12 | = hidden_field_tag :status, params[:status] |
13 | = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" | 13 | = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" |