diff --git a/lms/static/js/financial-assistance/views/financial_assistance_form_view.js b/lms/static/js/financial-assistance/views/financial_assistance_form_view.js index 444b3cc24a..bcd80d508e 100644 --- a/lms/static/js/financial-assistance/views/financial_assistance_form_view.js +++ b/lms/static/js/financial-assistance/views/financial_assistance_form_view.js @@ -10,6 +10,7 @@ 'text!../../../templates/financial-assistance/financial_assessment_form.underscore', 'text!../../../templates/financial-assistance/financial_assessment_submitted.underscore', 'text!templates/student_account/form_field.underscore', + 'edx-ui-toolkit/js/utils/html-utils', 'string_utils' ], function( @@ -21,7 +22,8 @@ FormView, formViewTpl, successTpl, - formFieldTpl + formFieldTpl, + HtmlUtils ) { return FormView.extend({ el: '.financial-assistance-wrapper', @@ -74,7 +76,7 @@ fields: html || '' }); - this.$el.html(_.template(this.tpl)(data)); + HtmlUtils.setHtml(this.$el, HtmlUtils.template(this.tpl)(data)); this.postRender(); this.validateCountry(); @@ -83,7 +85,7 @@ }, renderSuccess: function() { - this.$el.html(_.template(this.successTpl)({ + HtmlUtils.setHtml(this.$el, HtmlUtils.template(this.successTpl)({ course: this.model.get('course'), dashboard_url: this.context.dashboard_url })); @@ -103,7 +105,9 @@ msg = gettext('An error has occurred. Check your Internet connection and try again.'); } - this.errors = ['
  • ' + msg + '
  • ']; + this.errors = [HtmlUtils.joinHtml( + HtmlUtils.HTML('
  • '), msg, HtmlUtils.HTML('
  • ') + ).toString()]; this.renderErrors(this.defaultFormErrorsTitle, this.errors); this.toggleDisableButton(false); }, @@ -122,14 +126,22 @@ // Translators: link_start and link_end denote the html to link back to the profile page. gettext(txt.join('')), { - link_start: '', + link_start: HtmlUtils.joinHtml( + HtmlUtils.HTML('') + ).toString(), link_end: '' } ); if (!this.model.get('country')) { $countryLabel.addClass('error'); - this.renderErrors(this.defaultFormErrorsTitle, ['
  • ' + msg + '
  • ']); + this.renderErrors(this.defaultFormErrorsTitle, [HtmlUtils.joinHtml( + HtmlUtils.HTML('
  • '), + msg, + HtmlUtils.HTML('
  • ') + ).toString()]); this.toggleDisableButton(true); } },