From 26f4b0f54b52826144769828118835b736a6798c Mon Sep 17 00:00:00 2001 From: Ali-D-Akbar Date: Wed, 3 Jun 2020 20:01:59 +0500 Subject: [PATCH] PROD-1280 --- .../js/certificates/views/certificate_preview.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/cms/static/js/certificates/views/certificate_preview.js b/cms/static/js/certificates/views/certificate_preview.js index d07f3d1fdc..5300f784c9 100644 --- a/cms/static/js/certificates/views/certificate_preview.js +++ b/cms/static/js/certificates/views/certificate_preview.js @@ -8,9 +8,10 @@ define([ 'js/views/baseview', 'common/js/components/utils/view_utils', 'common/js/components/views/feedback_notification', - 'text!templates/certificate-web-preview.underscore' + 'text!templates/certificate-web-preview.underscore', + 'edx-ui-toolkit/js/utils/html-utils' ], -function(_, gettext, BaseView, ViewUtils, NotificationView, certificateWebPreviewTemplate) { +function(_, gettext, BaseView, ViewUtils, NotificationView, certificateWebPreviewTemplate, HtmlUtils) { 'use strict'; var CertificateWebPreview = BaseView.extend({ el: $('.preview-certificate'), @@ -27,7 +28,7 @@ function(_, gettext, BaseView, ViewUtils, NotificationView, certificateWebPrevie }, render: function() { - this.$el.html(_.template(certificateWebPreviewTemplate)({ + HtmlUtils.setHtml(this.$el, HtmlUtils.template(certificateWebPreviewTemplate)({ course_modes: this.course_modes, certificate_web_view_url: this.certificate_web_view_url, is_active: this.is_active @@ -36,13 +37,8 @@ function(_, gettext, BaseView, ViewUtils, NotificationView, certificateWebPrevie }, toggleCertificateActivation: function() { - var msg = 'Activating'; - if (this.is_active) { - msg = 'Deactivating'; - } - var notification = new NotificationView.Mini({ - title: gettext(msg) + title: gettext(this.is_active ? 'Deactivating' : 'Activating') }); $.ajax({