From 354d30df31bbc783aa512ce603ee53d604b0c64d Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 11 Jan 2021 12:26:44 +0000 Subject: Add class 'error' to custom fields with validation errors (#32764, #34580). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20710 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/custom_fields_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/helpers') diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index 41b20c46a..2845c8673 100644 --- a/app/helpers/custom_fields_helper.rb +++ b/app/helpers/custom_fields_helper.rb @@ -111,7 +111,8 @@ module CustomFieldsHelper content_tag( "label", content + (required ? " *".html_safe : ""), - :for => for_tag_id) + :for => for_tag_id, + :class => custom_value.customized && custom_value.customized.errors[custom_value.custom_field.name].present? ? 'error' : nil) end # Return custom field tag with its label tag -- cgit v1.2.3