diff --git a/app/views/branded/shared/dynamic_form/_form.html.erb b/app/views/branded/shared/dynamic_form/_form.html.erb index ceffb6a..31b3d45 100644 --- a/app/views/branded/shared/dynamic_form/_form.html.erb +++ b/app/views/branded/shared/dynamic_form/_form.html.erb @@ -14,8 +14,7 @@ <% field_id = fragment.present? ? "fragment_#{key}_#{fragment.id}" : "new_fragment_#{key}_#{SecureRandom.uuid}"%> <% validation = validations.nil? ? "none" : validations[key] %> <% required = required_fields.include?(key)%> - <% asterisk = required ? "*" : ""%> - <% label = "#{asterisk} #{prop["label@#{template_locale}"]}" %> + <% label = prop["label@#{template_locale}"]%> <% ttip = prop["tooltip@#{template_locale}"] %> <% dropdownValues = prop["values@#{template_locale}"]%> <% example = prop["example@#{template_locale}"] ? "ex: #{prop["example@#{template_locale}"]}": nil %> diff --git a/app/views/branded/shared/dynamic_form/fields/_date_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_date_field.html.erb index b5f5a42..6f9327e 100644 --- a/app/views/branded/shared/dynamic_form/fields/_date_field.html.erb +++ b/app/views/branded/shared/dynamic_form/fields/_date_field.html.erb @@ -1,6 +1,8 @@ <%# locals: { f, field_label, field_name, multiple, classname, field_name, field_id, required, readonly, validation } %> <% field_class = nil if local_assigns[:field_class].nil? %> <% field_label = field_label || 'No label defined' %> +<% field_label = required ? "* #{field_label}" : field_label%> + <% unless multiple %>
<%= f.label field_id, field_label, class: 'control-label' %> @@ -11,7 +13,6 @@ value: field_value, multiple: multiple, disabled: readonly, - required: required, class: "form-control #{field_class}", type: "date", id: field_id %> <% if multiple %> diff --git a/app/views/branded/shared/dynamic_form/fields/_number_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_number_field.html.erb index f256a18..1d7360f 100644 --- a/app/views/branded/shared/dynamic_form/fields/_number_field.html.erb +++ b/app/views/branded/shared/dynamic_form/fields/_number_field.html.erb @@ -1,6 +1,8 @@ <%# locals: { f, field_label, field_name, multiple, classname, field_name, field_id, required, readonly, validation, ttip } %> <% field_class = nil if local_assigns[:field_class].nil? %> <% field_label = field_label || 'No label defined' %> +<% field_label = required ? "* #{field_label}" : field_label%> + <% unless multiple %>
<%= f.label field_id, field_label, class: 'control-label' %> @@ -11,7 +13,6 @@ value: field_value, multiple: multiple, disabled: readonly, - required: required, class: "form-control #{field_class}", data: { toggle: 'tooltip' }, title: ttip, diff --git a/app/views/branded/shared/dynamic_form/fields/_select_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_select_field.html.erb index 52aa56f..e98f816 100644 --- a/app/views/branded/shared/dynamic_form/fields/_select_field.html.erb +++ b/app/views/branded/shared/dynamic_form/fields/_select_field.html.erb @@ -1,5 +1,7 @@ <%# locals: { f, field_label, field_name, select_values, selected_value, field_class, required, readonly, multiple, validation, ttip } %> <% field_label = field_label || 'No label defined' %> +<% field_label = required ? "* #{field_label}" : field_label%> + <% selected_value ||= default_value %> <% include_blank = !selected_value && !default_value %>
@@ -10,7 +12,6 @@ options_for_select(select_values, selected: selected_value), disabled: readonly, - required: required, multiple: multiple, include_blank: include_blank, "data-toggle": "tooltip", diff --git a/app/views/branded/shared/dynamic_form/fields/_text_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_text_field.html.erb index d6b35b2..e412596 100644 --- a/app/views/branded/shared/dynamic_form/fields/_text_field.html.erb +++ b/app/views/branded/shared/dynamic_form/fields/_text_field.html.erb @@ -1,5 +1,6 @@ <%# locals: { f, field_label, field_name, multiple, classname, field_id, required, readonly, validation, ttip, example } %> <% field_label = field_label || 'No label defined' %> +<% field_label = required ? "* #{field_label}" : field_label%> <% field_value ||= default_value %> <% unless multiple %> @@ -12,7 +13,6 @@ value: field_value, multiple: multiple, disabled: readonly, - required: required, class: "form-control #{field_class}", type: input_type, "data-toggle": "tooltip", diff --git a/app/views/branded/shared/dynamic_form/fields/_textarea_field.html.erb b/app/views/branded/shared/dynamic_form/fields/_textarea_field.html.erb index 4ce4d8c..797d54e 100644 --- a/app/views/branded/shared/dynamic_form/fields/_textarea_field.html.erb +++ b/app/views/branded/shared/dynamic_form/fields/_textarea_field.html.erb @@ -1,5 +1,6 @@ <%# locals: { f, field_label, field_id, field_name, multiple, classname, field_name, field_id, required, readonly, validation, ttip, example } %> <% field_label = field_label || 'No label defined' %> +<% field_label = required ? "* #{field_label}" : field_label%> <% field_value ||= default_value %> <% unless multiple %>
@@ -11,7 +12,6 @@ value: field_value, multiple: multiple, disabled: readonly, - required: required, class: "form-control #{field_class} tinymce_answer", type: input_type, placeholder: example,