Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Use include_blank options on the work package bulk edit form

Dombi Attilae77cd0cf4556
diff --git a/app/views/work_packages/bulk/edit.html.erb b/app/views/work_packages/bulk/edit.html.erb
index 7a682f26de3..10018db61ea 100644
--- a/app/views/work_packages/bulk/edit.html.erb
+++ b/app/views/work_packages/bulk/edit.html.erb
@@ -55,14 +55,22 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field">
<%= styled_label_tag :work_package_type_id, WorkPackage.human_attribute_name(:type) %>
<div class="form--field-container">
- <%= styled_select_tag("work_package[type_id]", "<option value=\"\">#{t(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@types, :id, :name)) %>
+ <%= styled_select_tag(
+ "work_package[type_id]",
+ options_from_collection_for_select(@types, :id, :name),
+ include_blank: t(:label_no_change_option)
+ ) %>
</div>
</div>
<% if @available_statuses.any? %>
<div class="form--field">
<%= styled_label_tag :work_package_status_id, WorkPackage.human_attribute_name(:status) %>
<div class="form--field-container">
- <%= styled_select_tag("work_package[status_id]", "<option value=\"\">#{t(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(@available_statuses, :id, :name)) %>
+ <%= styled_select_tag(
+ "work_package[status_id]",
+ options_from_collection_for_select(@available_statuses, :id, :name),
+ include_blank: t(:label_no_change_option)
+ ) %>
</div>
</div>
<% else %>
@@ -76,16 +84,21 @@ See COPYRIGHT and LICENSE files for more details.
<div class="form--field">
<%= styled_label_tag :work_package_priority_id, WorkPackage.human_attribute_name(:priority) %>
<div class="form--field-container">
- <%= styled_select_tag("work_package[priority_id]", "<option value=\"\">#{t(:label_no_change_option)}</option>".html_safe + options_from_collection_for_select(IssuePriority.active, :id, :name)) %>
+ <%= styled_select_tag(
+ "work_package[priority_id]",
+ options_from_collection_for_select(IssuePriority.active, :id, :name),
+ include_blank: t(:label_no_change_option)
+ ) %>
</div>
</div>
<div class="form--field">
<%= styled_label_tag :work_package_assigned_to_id, WorkPackage.human_attribute_name(:assigned_to) %>
<div class="form--field-container">
<%= styled_select_tag(
- "work_package[assigned_to_id]", content_tag("option", t(:label_no_change_option), value: "") +
- content_tag("option", t(:label_nobody), value: "none") +
- options_from_collection_for_select(@assignables, :id, :name)
+ "work_package[assigned_to_id]",
+ content_tag("option", t(:label_nobody), value: "none") +
+ options_from_collection_for_select(@assignables, :id, :name),
+ include_blank: t(:label_no_change_option)
) %>
</div>
</div>
@@ -93,9 +106,10 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_label_tag :work_package_responsible_id, WorkPackage.human_attribute_name(:responsible) %>
<div class="form--field-container">
<%= styled_select_tag(
- "work_package[responsible_id]", content_tag("option", t(:label_no_change_option), value: "") +
- content_tag("option", t(:label_nobody), value: "none") +
- options_from_collection_for_select(@responsibles, :id, :name)
+ "work_package[responsible_id]",
+ content_tag("option", t(:label_nobody), value: "none") +
+ options_from_collection_for_select(@responsibles, :id, :name),
+ include_blank: t(:label_no_change_option)
) %>
</div>
</div>
@@ -104,9 +118,10 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_label_tag :work_package_category_id, WorkPackage.human_attribute_name(:category) %>
<div class="form--field-container">
<%= styled_select_tag(
- "work_package[category_id]", content_tag("option", t(:label_no_change_option), value: "") +
- content_tag("option", t(:label_none), value: "none") +
- options_from_collection_for_select(@project.categories, :id, :name)
+ "work_package[category_id]",
+ content_tag("option", t(:label_none), value: "none") +
+ options_from_collection_for_select(@project.categories, :id, :name),
+ include_blank: t(:label_no_change_option)
) %>
</div>
</div>
@@ -115,9 +130,10 @@ See COPYRIGHT and LICENSE files for more details.
<%= styled_label_tag :work_package_version_id, WorkPackage.human_attribute_name(:version) %>
<div class="form--field-container">
<%= styled_select_tag(
- "work_package[version_id]", content_tag("option", t(:label_no_change_option), value: "") +
- content_tag("option", t(:label_none), value: "none") +
- version_options_for_select(@project.shared_versions.with_status_open.order_by_semver_name)
+ "work_package[version_id]",
+ content_tag("option", t(:label_none), value: "none") +
+ version_options_for_select(@project.shared_versions.with_status_open.order_by_semver_name),
+ include_blank: t(:label_no_change_option)
) %>
</div>
</div>