From 11aa7b00251d8fd29bb7f8c5a6176eb9713ff3ae Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 25 Nov 2013 18:57:44 +0200 Subject: [PATCH] Added ability to clear milestone/assignee during bulk update Signed-off-by: Dmitriy Zaporozhets --- app/helpers/issues_helper.rb | 8 ++++++++ app/views/projects/issues/_issues.html.haml | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 2221583912d..56b776cff46 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -68,4 +68,12 @@ module IssuesHelper false end end + + def bulk_update_milestone_options + options_for_select(["None (backlog)", nil]) + options_from_collection_for_select(project_active_milestones, "id", "title", params[:milestone_id]) + end + + def bulk_update_assignee_options + options_for_select(["None (unassigned)", nil]) + options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]) + end end diff --git a/app/views/projects/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml index 1ad1f10e1ed..0cde7acfcd1 100644 --- a/app/views/projects/issues/_issues.html.haml +++ b/app/views/projects/issues/_issues.html.haml @@ -6,8 +6,8 @@ = form_tag bulk_update_project_issues_path(@project), method: :post do %span Update selected issues with   = select_tag('update[status]', options_for_select(['open', 'closed']), prompt: "Status") - = select_tag('update[assignee_id]', options_from_collection_for_select(@project.team.members, "id", "name", params[:assignee_id]), prompt: "Assignee") - = select_tag('update[milestone_id]', options_from_collection_for_select(project_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") + = select_tag('update[assignee_id]', bulk_update_assignee_options, prompt: "Assignee") + = select_tag('update[milestone_id]', bulk_update_milestone_options, prompt: "Milestone") = hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag :status, params[:status] = button_tag "Save", class: "btn update_selected_issues btn-small btn-save"