diff --git a/lms/templates/courseware/course_about_sidebar_header.html b/lms/templates/courseware/course_about_sidebar_header.html index ee39af0a65..281ef98137 100644 --- a/lms/templates/courseware/course_about_sidebar_header.html +++ b/lms/templates/courseware/course_about_sidebar_header.html @@ -1,3 +1,4 @@ +<%page expression_filter="h"/> <%namespace name='static' file='../static_content.html'/> <%! import urllib @@ -24,35 +25,34 @@ from six import text_type ## Twitter account. {url} should appear at the end of the text. tweet_text = _("I just enrolled in {number} {title} through {account}: {url}").format( number=course.number, - title=course.display_name_with_default_escaped, + title=course.display_name_with_default, account=static.get_value('course_about_twitter_account', settings.PLATFORM_TWITTER_ACCOUNT), url=u"{protocol}://{domain}{path}".format( protocol=site_protocol, domain=site_domain, - path=urllib.quote_plus( - reverse('about_course', args=[text_type(course.id)]) - ) + path=reverse('about_course', args=[text_type(course.id)]) ) ).replace(u" ", u"+") - tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=tweet_text) + tweet_action = u"http://twitter.com/intent/tweet?text={tweet_text}".format(tweet_text=urllib.quote_plus(tweet_text.encode('UTF-8'))) facebook_link = static.get_value('course_about_facebook_link', settings.PLATFORM_FACEBOOK_ACCOUNT) - email_subject = u"mailto:?subject={subject}&body={body}".format( - subject=_("Take a course with {platform} online").format(platform=platform_name), - body=_("I just enrolled in {number} {title} through {platform} {url}").format( + email_body = _("I just enrolled in {number} {title} through {platform} {url}").format( number=course.number, - title=course.display_name_with_default_escaped, + title=course.display_name_with_default, platform=platform_name, url=u"{protocol}://{domain}{path}".format( protocol=site_protocol, domain=site_domain, - path=urllib.quote_plus( - reverse('about_course', args=[text_type(course.id)]), - ) + path=reverse('about_course', args=[text_type(course.id)]), ) - ) ).replace(u" ", u"%20") + + email_subject = _("Take a course with {platform} online").format(platform=platform_name) + email_link = u"mailto:?subject={subject}&body={body}".format( + subject=urllib.quote_plus(email_subject.encode('UTF-8')), + body=urllib.quote_plus(email_body.encode('UTF-8')) + ) %> ${_("Tweet that you've enrolled in this course")} @@ -60,7 +60,7 @@ from six import text_type ${_("Post a Facebook message to say you've enrolled in this course")} - + ${_("Email someone to say you've enrolled in this course")} diff --git a/lms/templates/dashboard/_dashboard_credit_info.html b/lms/templates/dashboard/_dashboard_credit_info.html index 230124c553..b4f7622a64 100644 --- a/lms/templates/dashboard/_dashboard_credit_info.html +++ b/lms/templates/dashboard/_dashboard_credit_info.html @@ -1,20 +1,23 @@ -<%page args="credit_status" /> +<%page args="credit_status" expression_filter="h"/> <%! from django.utils.translation import ugettext as _ + from openedx.core.djangolib.markup import HTML, Text %> <%namespace name='static' file='../static_content.html'/> % if credit_status["eligible"]: <% - provider_link = '{name}'.format( + provider_link = HTML('{name}').format( href=credit_status["provider_status_url"], name=credit_status["provider_name"]) error = credit_status['error'] # Translators: provider_name is the name of a credit provider or university (e.g. State University) - credit_msg = _("You have completed this course and are eligible to purchase course credit. Select Get Credit to get started.") + credit_msg = Text(_("You have completed this course and are eligible to purchase course credit. Select {strong_start}Get Credit{strong_end} to get started.")).format( + strong_start=HTML(''), + strong_end=HTML('>')) if credit_status['provider_name']: credit_msg = _("You are now eligible for credit from {provider}. Congratulations!").format(provider=credit_status['provider_name']) @@ -32,8 +35,10 @@ # Learner must initiate the credit request # Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a credit provider, such as 'State University' or 'Happy Fun Company'. - credit_msg = _("Thank you for your payment. To receive course credit, you must now request credit " - "at the {link_to_provider_site} website. Select Request Credit to get started.").format( + credit_msg = Text(_("Thank you for your payment. To receive course credit, you must now request credit " + "at the {link_to_provider_site} website. Select {start_bold}Request Credit{end_bold} to get started.")).format( + start_bold=HTML(''), + end_bold=HTML(''), link_to_provider_site=provider_link, ) credit_msg_class = "credit-request-not-started-msg" @@ -49,7 +54,9 @@ elif request_status == 'approved': # Credit granted! # Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a credit provider, such as 'State University' or 'Happy Fun Company'. provider_name is the name of credit provider. - credit_msg = _("Congratulations! {provider_name} has approved your request for course credit. To see your course credit, visit the {link_to_provider_site} website.").format( + credit_msg = Text(_("{start_bold}Congratulations!{end_bold} {provider_name} has approved your request for course credit. To see your course credit, visit the {link_to_provider_site} website.")).format( + start_bold=HTML(''), + end_bold=HTML(''), provider_name=credit_status["provider_name"], link_to_provider_site=provider_link, ) @@ -59,7 +66,7 @@ elif request_status == 'rejected': # REJECTED (by the credit provider)! ## Translators: link_to_provider_site is a link to an external webpage. The text of the link will be the name of a credit provider, such as 'State University' or 'Happy Fun Company'. provider_name is the name of credit provider. - credit_msg = _("{provider_name} did not approve your request for course credit. For more information, contact {link_to_provider_site} directly.").format( + credit_msg = Text(_("{provider_name} did not approve your request for course credit. For more information, contact {link_to_provider_site} directly.")).format( provider_name=credit_status["provider_name"], link_to_provider_site=provider_link, ) @@ -70,15 +77,15 @@