From 39e97da2f8f6c329a83c84d3f1e801ba8e05d69b Mon Sep 17 00:00:00 2001 From: azanbinzahid Date: Fri, 27 Nov 2020 23:50:39 +0500 Subject: [PATCH] PROD-2126 --- .../static/support/js/views/certificates.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lms/djangoapps/support/static/support/js/views/certificates.js b/lms/djangoapps/support/static/support/js/views/certificates.js index a704eab79f..310f1eb357 100644 --- a/lms/djangoapps/support/static/support/js/views/certificates.js +++ b/lms/djangoapps/support/static/support/js/views/certificates.js @@ -7,8 +7,9 @@ 'gettext', 'support/js/collections/certificate', 'text!support/templates/certificates.underscore', - 'text!support/templates/certificates_results.underscore' - ], function(Backbone, _, gettext, CertCollection, certificatesTpl, resultsTpl) { + 'text!support/templates/certificates_results.underscore', + 'edx-ui-toolkit/js/utils/html-utils' + ], function(Backbone, _, gettext, CertCollection, certificatesTpl, resultsTpl, HtmlUtils) { return Backbone.View.extend({ events: { 'submit .certificates-form': 'search', @@ -24,7 +25,7 @@ }, render: function() { - this.$el.html(_.template(certificatesTpl)); + this.$el.html(HtmlUtils.HTML(_.template(certificatesTpl)).toString()); // If there is an initial filter, then immediately trigger a search. // This is useful because it allows users to share search results: @@ -44,12 +45,12 @@ certificates: this.certificates }; - this.setResults(_.template(resultsTpl)(context)); + this.setResults(HtmlUtils.template(resultsTpl)(context)); }, renderError: function(error) { var errorMsg = error || gettext('An unexpected error occurred. Please try again.'); - this.setResults(errorMsg); + this.setResults(HtmlUtils.Text(errorMsg)); }, search: function(event) { @@ -170,7 +171,10 @@ }, setResults: function(html) { - $('.certificates-results', this.$el).html(html); + HtmlUtils.setHtml( + $('.certificates-results', this.$el), + html + ); }, disableButtons: function() {