From 858eb20bd953402acde08fb8c636cc5749f26807 Mon Sep 17 00:00:00 2001 From: Marius BALTEANU Date: Sat, 4 Apr 2020 18:14:52 +0300 Subject: [PATCH 1/3] Use same layout for custom fields in issue bulk edit page --- app/views/issues/bulk_edit.html.erb | 38 +++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/app/views/issues/bulk_edit.html.erb b/app/views/issues/bulk_edit.html.erb index f5590e9bc..663b80038 100644 --- a/app/views/issues/bulk_edit.html.erb +++ b/app/views/issues/bulk_edit.html.erb @@ -94,13 +94,6 @@

<% end %> -<% @custom_fields.each do |custom_field| %> -

- - <%= custom_field_tag_for_bulk_edit('issue', custom_field, @issues, @issue_params[:custom_field_values][custom_field.id.to_s]) %> -

-<% end %> - <% if @copy && Setting.link_copied_issue == 'ask' %>

@@ -190,6 +183,37 @@ <% end %> + +<% custom_fields = @custom_fields %> +<% custom_fields_full_width = custom_fields.select { |value| value.full_width_layout? } %> +<% custom_fields -= custom_fields_full_width %> + +<% if custom_fields.present? %> +

+
+ <% i = 0 %> + <% split_on = (custom_fields.size / 2.0).ceil - 1 %> + <% custom_fields.each do |custom_field| %> +

+ + <%= custom_field_tag_for_bulk_edit('issue', custom_field, @issues, @issue_params[:custom_field_values][custom_field.id.to_s]) %> +

+ <% if i == split_on %> +
+ <% end %> + <% i += 1 %> + <% end %> +
+
+<% end %> + +<% custom_fields_full_width.each do |custom_field| %> +

+ + <%= custom_field_tag_for_bulk_edit('issue', custom_field, @issues, @issue_params[:custom_field_values][custom_field.id.to_s]) %> +

+<% end %> +
-- 2.22.0