diff --git a/lms/templates/commerce/checkout_cancel.html b/lms/templates/commerce/checkout_cancel.html index d2f03e07d0..08566ddb3c 100644 --- a/lms/templates/commerce/checkout_cancel.html +++ b/lms/templates/commerce/checkout_cancel.html @@ -1,4 +1,7 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%> <%inherit file="../main.html" /> @@ -7,6 +10,6 @@

${_("Checkout Cancelled")}

- ${ _(u"Your transaction has been cancelled. If you feel an error has occurred, contact {email}.").format( - email="{email}".format(email=payment_support_email)) } + ${ Text(_(u"Your transaction has been cancelled. If you feel an error has occurred, contact {email}.")).format( + email=HTML("{email}").format(email=payment_support_email)) }
diff --git a/lms/templates/commerce/checkout_error.html b/lms/templates/commerce/checkout_error.html index df170377f4..ecc8dc596a 100644 --- a/lms/templates/commerce/checkout_error.html +++ b/lms/templates/commerce/checkout_error.html @@ -1,4 +1,7 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%> <%inherit file="../main.html" /> @@ -7,6 +10,8 @@

${_("Checkout Error")}

- ${ _(u"An error has occurred with your payment. You have not been charged. Please try to submit your payment again. If this problem persists, contact {email}.").format( - email="{email}".format(email=payment_support_email)) } + ${ Text(_(u"An error has occurred with your payment. {b_start}You have not been charged.{b_end} Please try to submit your payment again. If this problem persists, contact {email}.")).format( + b_start=HTML(''), + b_end=HTML(''), + email=HTML("{email}").format(email=payment_support_email)) }
diff --git a/lms/templates/commerce/checkout_receipt.html b/lms/templates/commerce/checkout_receipt.html index 0d4587fb14..2b89d30100 100644 --- a/lms/templates/commerce/checkout_receipt.html +++ b/lms/templates/commerce/checkout_receipt.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> diff --git a/lms/templates/courseware/courseware-error.html b/lms/templates/courseware/courseware-error.html index a07b7fa266..2d7babaf28 100644 --- a/lms/templates/courseware/courseware-error.html +++ b/lms/templates/courseware/courseware-error.html @@ -1,4 +1,7 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%> <%inherit file="/main.html" /> <%namespace name='static' file='../static_content.html'/> <%block name="bodyclass">courseware @@ -18,14 +21,14 @@ from openedx.core.djangolib.markup import HTML, Text

- ${_('There has been an error on the {platform_name} servers').format( - platform_name=u'{}'.format(static.get_platform_name()) + ${Text(_('There has been an error on the {platform_name} servers')).format( + platform_name=HTML(u'{}').format(static.get_platform_name()) )}

- ${_("We're sorry, this module is temporarily unavailable. Our staff is working to fix " - "it as soon as possible. Please email us at {tech_support_email} to report any problems or downtime.").format( - tech_support_email=u'{0}'.format(static.get_tech_support_email_address()) + ${Text(_("We're sorry, this module is temporarily unavailable. Our staff is working to fix " + "it as soon as possible. Please email us at {tech_support_email} to report any problems or downtime.")).format( + tech_support_email=HTML(u'{0}').format(static.get_tech_support_email_address()) )}

diff --git a/lms/templates/debug/run_python_form.html b/lms/templates/debug/run_python_form.html index 2d29480f4c..0c2abbfe80 100644 --- a/lms/templates/debug/run_python_form.html +++ b/lms/templates/debug/run_python_form.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %>
@@ -5,7 +6,7 @@
- +
@@ -14,7 +15,7 @@

${_("Results:")}

-${results|h}
+${results}
 
%endif diff --git a/lms/templates/email_change_failed.html b/lms/templates/email_change_failed.html index 557925c862..8fbe6c4654 100644 --- a/lms/templates/email_change_failed.html +++ b/lms/templates/email_change_failed.html @@ -1,4 +1,7 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%> <%inherit file="main.html" /> @@ -14,6 +17,8 @@

${_("We were unable to send a confirmation email to {email}").format(email=email)}

% endif -

${_('Go back to the {link_start}home page{link_end}.').format(link_start='', link_end='')}

+

${Text(_('Go back to the {link_start}home page{link_end}.')).format( + link_start=HTML(''), + link_end=HTML(''))}

diff --git a/lms/templates/email_change_successful.html b/lms/templates/email_change_successful.html index b58972785c..e91da6a294 100644 --- a/lms/templates/email_change_successful.html +++ b/lms/templates/email_change_successful.html @@ -1,6 +1,8 @@ +<%page expression_filter="h"/> <%inherit file="main.html" /> <%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text from django.urls import reverse %> @@ -10,9 +12,9 @@ from django.urls import reverse

${_("E-mail change successful!")}


-

${_('You should see your new email in your {link_start}dashboard{link_end}.').format( - link_start=''.format(url=reverse('dashboard')), - link_end='', +

${Text(_('You should see your new email in your {link_start}dashboard{link_end}.')).format( + link_start=HTML('').format(url=reverse('dashboard')), + link_end=HTML(''), )}

diff --git a/lms/templates/email_exists.html b/lms/templates/email_exists.html index 15df3e76b7..ce3848578a 100644 --- a/lms/templates/email_exists.html +++ b/lms/templates/email_exists.html @@ -1,4 +1,7 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%> <%inherit file="main.html" /> @@ -10,6 +13,8 @@

${_("An account with the new e-mail address already exists.")}

-

${_("Go back to the {link_start}home page{link_end}.").format(link_start='', link_end='')}

+

${Text(_("Go back to the {link_start}home page{link_end}.")).format( + link_start=HTML(''), + link_end=HTML(''))}

diff --git a/lms/templates/embargo/default_courseware.html b/lms/templates/embargo/default_courseware.html index 9533bc722d..c1431c61b1 100644 --- a/lms/templates/embargo/default_courseware.html +++ b/lms/templates/embargo/default_courseware.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> <%inherit file="../main.html" /> diff --git a/lms/templates/embargo/default_enrollment.html b/lms/templates/embargo/default_enrollment.html index 168cad5304..0989ec1638 100644 --- a/lms/templates/embargo/default_enrollment.html +++ b/lms/templates/embargo/default_enrollment.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> <%inherit file="../main.html" /> diff --git a/lms/templates/enroll_students.html b/lms/templates/enroll_students.html index 5d3e2f798a..6b3074fe89 100644 --- a/lms/templates/enroll_students.html +++ b/lms/templates/enroll_students.html @@ -1,3 +1,4 @@ +<%page expression_filter="h" /> <%! from django.utils.translation import ugettext as _ %>

${_("Student Enrollment Form")}

diff --git a/lms/templates/extauth_failure.html b/lms/templates/extauth_failure.html index 9c92e39433..04db00eaf6 100644 --- a/lms/templates/extauth_failure.html +++ b/lms/templates/extauth_failure.html @@ -1,3 +1,4 @@ +<%page expression_filter="h" /> <%! from django.utils.translation import ugettext as _ %> <%inherit file="../main.html"/> <% from django.urls import reverse diff --git a/lms/templates/instructor/instructor_dashboard_2/executive_summary.html b/lms/templates/instructor/instructor_dashboard_2/executive_summary.html index e118fb2377..16563054c2 100644 --- a/lms/templates/instructor/instructor_dashboard_2/executive_summary.html +++ b/lms/templates/instructor/instructor_dashboard_2/executive_summary.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> diff --git a/lms/templates/invalid_email_key.html b/lms/templates/invalid_email_key.html index b0d9c188e4..3b84cea755 100644 --- a/lms/templates/invalid_email_key.html +++ b/lms/templates/invalid_email_key.html @@ -1,5 +1,8 @@ +<%page expression_filter="h" /> <%inherit file="main.html" /> -<%! from django.utils.translation import ugettext as _ %> +<%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text +%>
@@ -12,6 +15,6 @@
  • ${_("Did your e-mail client break the URL into two lines?")}
  • ${_("The keys are valid for a limited amount of time. Has the key expired?")} -

    ${_('Go back to the {link_start}home page{link_end}.').format(link_start='', link_end='')}

    +

    ${Text(_('Go back to the {link_start}home page{link_end}.')).format(link_start=HTML(''), link_end=HTML(''))}

  • diff --git a/lms/templates/library-block-author-preview-header.html b/lms/templates/library-block-author-preview-header.html index b4de62d8a0..220d16426c 100644 --- a/lms/templates/library-block-author-preview-header.html +++ b/lms/templates/library-block-author-preview-header.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ungettext %>
    diff --git a/lms/templates/lti.html b/lms/templates/lti.html index e87bef0084..486c5d652d 100644 --- a/lms/templates/lti.html +++ b/lms/templates/lti.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! import json from django.utils.translation import ugettext as _ @@ -61,7 +62,7 @@ from django.utils.translation import ugettext as _ % endif diff --git a/lms/templates/peer_grading/peer_grading_closed.html b/lms/templates/peer_grading/peer_grading_closed.html index af5b606674..698d3763bc 100644 --- a/lms/templates/peer_grading/peer_grading_closed.html +++ b/lms/templates/peer_grading/peer_grading_closed.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %>

    ${_("Peer Grading")}

    diff --git a/lms/templates/provider_login.html b/lms/templates/provider_login.html index d252261621..ae8307e4ab 100644 --- a/lms/templates/provider_login.html +++ b/lms/templates/provider_login.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> <%inherit file="main.html" /> diff --git a/lms/templates/register-form.html b/lms/templates/register-form.html index aa543efe73..0a4cb5d5ff 100644 --- a/lms/templates/register-form.html +++ b/lms/templates/register-form.html @@ -1,7 +1,9 @@ +<%page expression_filter="h"/> <%! import third_party_auth from third_party_auth import pipeline, provider from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import HTML, Text from django_countries import countries from student.models import UserProfile %> @@ -26,7 +28,7 @@ from student.models import UserProfile % for enabled in provider.Registry.displayed_for_login(): ## Translators: provider_name is the name of an external, third-party user authentication service (like Google or LinkedIn). -
    % endif % endif @@ -264,5 +269,5 @@ from student.models import UserProfile
    - +
    diff --git a/lms/templates/shoppingcart/download_report.html b/lms/templates/shoppingcart/download_report.html index 83094091b1..3f7c4bf91f 100644 --- a/lms/templates/shoppingcart/download_report.html +++ b/lms/templates/shoppingcart/download_report.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%inherit file="../main.html" /> <%! from django.utils.translation import ugettext as _ diff --git a/lms/templates/shoppingcart/shopping_cart_flow.html b/lms/templates/shoppingcart/shopping_cart_flow.html index 56c4c12d74..d04946edc0 100644 --- a/lms/templates/shoppingcart/shopping_cart_flow.html +++ b/lms/templates/shoppingcart/shopping_cart_flow.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%inherit file="../main.html" /> <%namespace name='static' file='/static_content.html'/> <%! diff --git a/lms/templates/student_account/finish_auth.html b/lms/templates/student_account/finish_auth.html index 0dcc3c38ef..3cd8d1d21e 100644 --- a/lms/templates/student_account/finish_auth.html +++ b/lms/templates/student_account/finish_auth.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ %> <%namespace name='static' file='/static_content.html'/> <%inherit file="/main.html" /> diff --git a/lms/templates/support/enrollment.html b/lms/templates/support/enrollment.html index d5dc8e2d7a..355242b34a 100644 --- a/lms/templates/support/enrollment.html +++ b/lms/templates/support/enrollment.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ from openedx.core.djangolib.js_utils import js_escaped_string diff --git a/lms/templates/support/index.html b/lms/templates/support/index.html index b270deb22f..dc263ea624 100644 --- a/lms/templates/support/index.html +++ b/lms/templates/support/index.html @@ -1,4 +1,5 @@ ## mako +<%page expression_filter="h"/> <%! from django.urls import reverse from django.utils.translation import ugettext as _ diff --git a/lms/templates/verify_student/_verification_help.html b/lms/templates/verify_student/_verification_help.html index bc213d5f1c..9520638525 100644 --- a/lms/templates/verify_student/_verification_help.html +++ b/lms/templates/verify_student/_verification_help.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%! from django.utils.translation import ugettext as _ from openedx.core.djangolib.markup import HTML, Text