From 5f9d41b124aba286a413c19a478d37d677714559 Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Tue, 11 Aug 2020 17:39:59 +0500 Subject: [PATCH 1/4] PROD-1290 --- cms/static/js/views/container.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cms/static/js/views/container.js b/cms/static/js/views/container.js index 8deefb758b9c..5d43112bb701 100644 --- a/cms/static/js/views/container.js +++ b/cms/static/js/views/container.js @@ -1,9 +1,9 @@ define([ 'jquery', 'underscore', 'js/views/xblock', 'js/utils/module', - 'gettext', 'common/js/components/views/feedback_notification', - 'jquery.ui' + 'gettext', 'edx-ui-toolkit/js/utils/string-utils', + 'common/js/components/views/feedback_notification', 'jquery.ui' ], // The container view uses sortable, which is provided by jquery.ui. - function($, _, XBlockView, ModuleUtils, gettext, NotificationView) { + function($, _, XBlockView, ModuleUtils, gettext, StringUtils, NotificationView) { 'use strict'; var studioXBlockWrapperClass = '.studio-xblock-wrapper'; @@ -142,7 +142,15 @@ define([ }, makeRequestSpecificSelector: function(selector) { - return 'div.xblock[data-request-token="' + this.requestToken + '"] > ' + selector; + return StringUtils.interpolate( + gettext('{startTag}{requestToken}{endTag}{selector}'), + { + startTag: 'div.xblock[data-request-token="', + requestToken: this.requestToken, + endTag: '"] > ', + selector: selector + } + ); } }); From e1a56724119b17d7253b42b8bd8cefb6b960c89c Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Tue, 11 Aug 2020 17:40:39 +0500 Subject: [PATCH 2/4] PROD-1292 --- cms/static/js/views/experiment_group_edit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cms/static/js/views/experiment_group_edit.js b/cms/static/js/views/experiment_group_edit.js index cb7388c9629f..4b4470e6123c 100644 --- a/cms/static/js/views/experiment_group_edit.js +++ b/cms/static/js/views/experiment_group_edit.js @@ -29,7 +29,7 @@ function(BaseView, _, str, gettext, groupEditTemplate) { var collection = this.model.collection, index = collection.indexOf(this.model); - this.$el.html(_.template(groupEditTemplate)({ + edx.HtmlUtils.setHtml(this.$el, edx.HtmlUtils.template(groupEditTemplate)({ name: this.model.get('name'), allocation: this.getAllocation(), index: index, From 00a4e1b8d70e2b5dd5f9d665e39e25544f26b01f Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Tue, 11 Aug 2020 17:42:26 +0500 Subject: [PATCH 3/4] PROD-1526 --- cms/static/js/views/learning_info.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cms/static/js/views/learning_info.js b/cms/static/js/views/learning_info.js index 57e75f301c82..d29dd67838bb 100644 --- a/cms/static/js/views/learning_info.js +++ b/cms/static/js/views/learning_info.js @@ -5,9 +5,10 @@ define([ 'underscore', 'backbone', 'gettext', - 'js/utils/templates' + 'js/utils/templates', + 'edx-ui-toolkit/js/utils/html-utils' ], -function($, _, Backbone, gettext, TemplateUtils) { +function($, _, Backbone, gettext, TemplateUtils, HtmlUtils) { 'use strict'; var LearningInfoView = Backbone.View.extend({ @@ -33,7 +34,12 @@ function($, _, Backbone, gettext, TemplateUtils) { var self = this; var learning_information = this.model.get('learning_info'); $.each(learning_information, function(index, info) { - $(self.el).append(self.template({index: index, info: info, info_count: learning_information.length})); + var attributes = { + index: index, + info: info, + info_count: learning_information.length + }; + $(self.el).append(HtmlUtils.HTML(self.template(attributes)).toString()); }); }, From 0631b4bc97e5d1bfd8c119fd24f73680937ebfc3 Mon Sep 17 00:00:00 2001 From: SaadYousaf Date: Tue, 11 Aug 2020 17:45:22 +0500 Subject: [PATCH 4/4] PROD-1529 --- cms/static/js/views/list_item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cms/static/js/views/list_item.js b/cms/static/js/views/list_item.js index e51c9caede53..22327ebbc7b2 100644 --- a/cms/static/js/views/list_item.js +++ b/cms/static/js/views/list_item.js @@ -12,9 +12,10 @@ * to the DOM. */ define([ - 'js/views/baseview', 'jquery', 'gettext', 'common/js/components/utils/view_utils' + 'js/views/baseview', 'jquery', 'gettext', + 'common/js/components/utils/view_utils', 'edx-ui-toolkit/js/utils/html-utils' ], function( - BaseView, $, gettext, ViewUtils + BaseView, $, gettext, ViewUtils, HtmlUtils ) { 'use strict'; @@ -81,7 +82,7 @@ define([ this.view = this.createDetailsView(); } - this.$el.html(this.view.render().el); + this.$el.html(HtmlUtils.HTML(this.view.render().el).toString()); return this; }