From a6fd6ca5ec32e5f350e7e14ac01c5feb183321aa Mon Sep 17 00:00:00 2001 From: Ayub-Khan Date: Wed, 2 Dec 2015 20:53:26 +0500 Subject: [PATCH 1/2] fix html escape error TNL-3822 --- cms/templates/container.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cms/templates/container.html b/cms/templates/container.html index c44ac74b84..549eaddc82 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -11,6 +11,7 @@ else: from contentstore.views.helpers import xblock_studio_url, xblock_type_display_name from django.utils.translation import ugettext as _ from openedx.core.lib.js_utils import escape_json_dumps +from markupsafe import Markup as HTML, escape as HTML_ESCAPE %> <%block name="title">${xblock.display_name_with_default} ${xblock_type_display_name(xblock) | h} <%block name="bodyclass">is-signedin course container view-container @@ -110,10 +111,10 @@ from openedx.core.lib.js_utils import escape_json_dumps % if xblock.category == 'split_test':

${_("Adding components")}

-

${_("Select a component type under {em_start}Add New Component{em_end}. Then select a template.").format(em_start='', em_end="") | h}

+

${_(HTML_ESCAPE("Select a component type under {em_start}Add New Component{em_end}. Then select a template.")).format(em_start=HTML(''), em_end=HTML(""))}

${_("The new component is added at the bottom of the page or group. You can then edit and move the component.")}

${_("Editing components")}

-

${_("Click the {em_start}Edit{em_end} icon in a component to edit its content.").format(em_start='', em_end="") | h}

+

${_(HTML_ESCAPE("Click the {em_start}Edit{em_end} icon in a component to edit its content.")).format(em_start=HTML(''), em_end=HTML(""))}

${_("Reorganizing components")}

${_("Drag components to new locations within this component.")}

${_("For content experiments, you can drag components to other groups.")}

From 2f6b1f9b8409776e47a877ddc0113ad34fb118d6 Mon Sep 17 00:00:00 2001 From: Ayub-Khan Date: Mon, 21 Dec 2015 11:56:50 +0500 Subject: [PATCH 2/2] -new code according to document. --- cms/templates/container.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cms/templates/container.html b/cms/templates/container.html index 549eaddc82..9edad15fd6 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -9,9 +9,8 @@ else: <%! from contentstore.views.helpers import xblock_studio_url, xblock_type_display_name -from django.utils.translation import ugettext as _ from openedx.core.lib.js_utils import escape_json_dumps -from markupsafe import Markup as HTML, escape as HTML_ESCAPE +from util.markup import HTML, ugettext as _ %> <%block name="title">${xblock.display_name_with_default} ${xblock_type_display_name(xblock) | h} <%block name="bodyclass">is-signedin course container view-container @@ -111,10 +110,16 @@ from markupsafe import Markup as HTML, escape as HTML_ESCAPE % if xblock.category == 'split_test':

${_("Adding components")}

-

${_(HTML_ESCAPE("Select a component type under {em_start}Add New Component{em_end}. Then select a template.")).format(em_start=HTML(''), em_end=HTML(""))}

+

${_("Select a component type under {strong_start}Add New Component{strong_end}. Then select a template.").format( + strong_start=HTML(''), + strong_end=HTML(""), + )}

${_("The new component is added at the bottom of the page or group. You can then edit and move the component.")}

${_("Editing components")}

-

${_(HTML_ESCAPE("Click the {em_start}Edit{em_end} icon in a component to edit its content.")).format(em_start=HTML(''), em_end=HTML(""))}

+

${_("Click the {strong_start}Edit{strong_end} icon in a component to edit its content.").format( + strong_start=HTML(''), + strong_end=HTML(""), + )}

${_("Reorganizing components")}

${_("Drag components to new locations within this component.")}

${_("For content experiments, you can drag components to other groups.")}