From aa490a70b3ddd1e99a8910bf133d164e0a218020 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 21 Jan 2016 05:15:45 +0000 Subject: Speeds up the custom field edit view when having hundreds of projects. git-svn-id: http://svn.redmine.org/redmine/trunk@15084 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/custom_fields/_form.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/views/custom_fields') diff --git a/app/views/custom_fields/_form.html.erb b/app/views/custom_fields/_form.html.erb index 99fffadeb..7c79189ac 100644 --- a/app/views/custom_fields/_form.html.erb +++ b/app/views/custom_fields/_form.html.erb @@ -102,8 +102,9 @@ when "IssueCustomField" %>
<%= l(:label_project_plural) %> + <% project_ids = @custom_field.project_ids.to_a %> <%= render_project_nested_lists(Project.all) do |p| - content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + p) + content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, project_ids.include?(p.id), :id => nil) + ' ' + p) end %> <%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>

<%= check_all_links 'custom_field_project_ids' %>

-- cgit v1.2.3