diff --git a/plugins/custom_forms/lib/custom_forms_plugin/helper.rb b/plugins/custom_forms/lib/custom_forms_plugin/helper.rb index 7984b6c..66b2a62 100644 --- a/plugins/custom_forms/lib/custom_forms_plugin/helper.rb +++ b/plugins/custom_forms/lib/custom_forms_plugin/helper.rb @@ -71,7 +71,7 @@ module CustomFormsPlugin::Helper def display_custom_field(field, submission, form) sanitized_name = ActionView::Base.white_list_sanitizer.sanitize field.name answer = submission.answers.select{|answer| answer.field == field}.first - field_tag = send("display_#{type_for_options(field.class)}",field, answer, form) + field_tag = send("display_#{type_for_options(field.class)}",field, answer, form).html_safe if field.mandatory? && submission.id.nil? required(labelled_form_field(sanitized_name, field_tag)) else diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_field.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_field.html.erb index e982a12..812eb25 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_field.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_field.html.erb @@ -12,7 +12,7 @@ <%= f.hidden_field(:position) %> <%= f.hidden_field :_destroy, :class => 'destroy-field' %> - <%= button_to_function :delete, _('Remove field'), "customFormsPlugin.removeFieldBox(this, #{CGI::escapeHTML(_('Are you sure you want to remove this field?').to_json)})" %> + <%= button_to_function :delete, _('Remove field'), "customFormsPlugin.removeFieldBox(this, #{_('Are you sure you want to remove this field?').to_json})" %> <%= yield %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb index 8e757c8..bc6dddd 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/_form.html.erb @@ -51,8 +51,8 @@
<%= button_bar do %> diff --git a/plugins/custom_forms/views/custom_forms_plugin_myprofile/custom_forms_plugin/_alternative.html.erb b/plugins/custom_forms/views/custom_forms_plugin_myprofile/custom_forms_plugin/_alternative.html.erb index f312254..cd31867 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_myprofile/custom_forms_plugin/_alternative.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_myprofile/custom_forms_plugin/_alternative.html.erb @@ -7,6 +7,6 @@<%= @form.description %>
+<%= @form.description.html_safe %>
<% if @submission.id.nil? %> <% if @form.expired? %> diff --git a/plugins/custom_forms/views/shared/_form_submission.html.erb b/plugins/custom_forms/views/shared/_form_submission.html.erb index ec2f336..ecb9fe0 100644 --- a/plugins/custom_forms/views/shared/_form_submission.html.erb +++ b/plugins/custom_forms/views/shared/_form_submission.html.erb @@ -1,5 +1,5 @@ <% self.extend(CustomFormsPlugin::Helper) %> <% @form.fields.each do |field| %> - <%= display_custom_field(field, @submission, f.object_name) %> + <%= display_custom_field(field, @submission, f.object_name).html_safe %> <% end %> -- libgit2 0.21.2