Commit 80c3f842 by Robert Raposa

Fix safe template issues for 0 violations for some rules

parent 73966d1a
......@@ -19,9 +19,9 @@ from openedx.core.djangolib.markup import Text, HTML
${_('The page that you were looking for was not found.')}
${Text(_('Go back to the {homepage} or let us know about any pages that may have been moved at {email}.')).format(
homepage=HTML('<a href="/">homepage</a>'),
email=HTML('<a href="mailto:{address}">{address}</a>'.format(
email=HTML('<a href="mailto:{address}">{address}</a>').format(
address=Text(settings.TECH_SUPPORT_EMAIL)
))
)
)}
</p>
</article>
......
......@@ -30,9 +30,9 @@ ${Text(_("{studio_name} Server Error")).format(
)}
${_("We've logged the error and our staff is currently working to resolve this error as soon as possible.")}
${Text(_(u'If the problem persists, please email us at {email_link}.')).format(
email_link=HTML(u'<a href="mailto:{email_address}">{email_address}</a>'.format(
email_link=HTML(u'<a href="mailto:{email_address}">{email_address}</a>').format(
email_address=Text(settings.TECH_SUPPORT_EMAIL),
))
)
)}
</p>
</article>
......
......@@ -121,7 +121,7 @@ from openedx.core.djangolib.markup import Text, HTML
<h3 class="sr">${_("Page Actions")}</h3>
<ul>
<li class="nav-item">
<a href="#" class="button button-new" data-category="chapter" data-parent="${context_course.location | h}" data-default-name="${_('Section')}" title="${_('Click to add a new section')}">
<a href="#" class="button button-new" data-category="chapter" data-parent="${context_course.location}" data-default-name="${_('Section')}" title="${_('Click to add a new section')}">
<i class="icon fa fa-plus"></i>${_('New Section')}
</a>
</li>
......
......@@ -103,7 +103,7 @@ from openedx.core.djangolib.markup import Text, HTML
<h3 class="title-3">${_("Other Course Settings")}</h3>
<nav class="nav-related" aria-label="${_('Other Course Settings')}">
<ul>
<li class="nav-item"><a href="${details_url}">${_("Details &amp; Schedule")}</a></li>
<li class="nav-item"><a href="${details_url}">${_("Details & Schedule")}</a></li>
<li class="nav-item"><a href="${grading_url}">${_("Grading")}</a></li>
<li class="nav-item"><a href="${course_team_url}">${_("Course Team")}</a></li>
<li class="nav-item"><a href="${advanced_settings_url}">${_("Advanced Settings")}</a></li>
......
<%page expression_filter="h"/>
<%page expression_filter="h" args="online_help_token"/>
<%namespace name='static' file='../static_content.html'/>
<%!
from django.conf import settings
......@@ -6,7 +6,6 @@
from django.utils.translation import ugettext as _
from contentstore.context_processors import doc_url
%>
<%page args="online_help_token"/>
<div class="wrapper-header wrapper" id="view-top">
<header class="primary" role="banner">
......@@ -61,7 +60,7 @@
<a href="${tabs_url}">${_("Pages")}</a>
</li>
<li class="nav-item nav-course-courseware-uploads">
<a href="${assets_url}">${_("Files &amp; Uploads")}</a>
<a href="${assets_url}">${_("Files & Uploads")}</a>
</li>
<li class="nav-item nav-course-courseware-textbooks">
<a href="${textbooks_url}">${_("Textbooks")}</a>
......@@ -83,7 +82,7 @@
<div class="nav-sub">
<ul>
<li class="nav-item nav-course-settings-schedule">
<a href="${settings_url}">${_("Schedule &amp; Details")}</a>
<a href="${settings_url}">${_("Schedule & Details")}</a>
</li>
<li class="nav-item nav-course-settings-grading">
<a href="${grading_url}">${_("Grading")}</a>
......
......@@ -14,7 +14,7 @@ from openedx.core.djangolib.markup import HTML, Text
link_start=HTML('<a href="{dashboard_url}" target="_blank">').format(
dashboard_url=escape_uri_path('{base_url}/courses/{course_id}'.format(
base_url=settings.ANALYTICS_DASHBOARD_URL,
course_id=Text(section_data['course_id'])
course_id=section_data['course_id'],
))
),
analytics_dashboard_name=settings.ANALYTICS_DASHBOARD_NAME,
......
......@@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _
from lms.djangoapps.ccx.overrides import get_current_ccx
from microsite_configuration import microsite
from microsite_configuration.templatetags.microsite import platform_name
from openedx.core.djangolib.markup import Text, HTML
from openedx.core.djangolib.markup import HTML, Text
# App that handles subdomain specific branding
from branding import api as branding_api
......@@ -194,15 +194,12 @@ site_status_msg = get_site_status_msg(course_id)
</header>
% if course:
<!--[if lte IE 9]>
<div class="ie-banner" aria-hidden="true">
${Text(_('{begin_strong}Warning:{end_strong} Your browser is not fully supported. We strongly recommend using {chrome_link} or {ff_link}.')).format(
<div class="ie-banner" aria-hidden="true">${Text(_('{begin_strong}Warning:{end_strong} Your browser is not fully supported. We strongly recommend using {chrome_link} or {ff_link}.')).format(
begin_strong=HTML('<strong>'),
end_strong=HTML('</strong>'),
chrome_link=HTML('<a href="https://www.google.com/chrome" target="_blank">Chrome</a>'),
ff_link=HTML('<a href="http://www.mozilla.org/firefox" target="_blank">Firefox</a>'),
)
}
</div>
)}</div>
<![endif]-->
% endif
......
......@@ -5,6 +5,8 @@ from paver.easy import sh, task, cmdopts, needs, BuildFailure
import os
import re
from openedx.core.djangolib.markup import HTML
from .utils.envs import Env
ALL_SYSTEMS = 'lms,cms,common,openedx,pavelib'
......@@ -428,9 +430,9 @@ def run_quality(options):
sep = '-------------<br/>\n'
title = "<h1>Quality Report: pep8</h1>\n"
violations_bullets = ''.join(
['<li>{violation}</li><br/>\n'.format(violation=violation) for violation in violations_list]
[HTML('<li>{violation}</li><br/>\n').format(violation=violation) for violation in violations_list]
)
violations_str = '<ul>\n{bullets}</ul>\n'.format(bullets=violations_bullets)
violations_str = HTML('<ul>\n{bullets}</ul>\n').format(bullets=HTML(violations_bullets))
violations_count_str = "<b>Violations</b>: {count}<br/>\n"
fail_line = "<b>FAILURE</b>: pep8 count should be 0<br/>\n"
else:
......
......@@ -6,6 +6,7 @@
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import HTML, Text
# App that handles subdomain specific branding
import branding
# app that handles site status messages
......@@ -59,9 +60,9 @@ site_status_msg = get_site_status_msg(course_id)
% if course and not disable_courseware_header:
<h2 class="course-header">
<span class="provider">${course.display_org_with_default | h}:</span>
<span class="course-number">${course.display_number_with_default | h}</span>
<span class="course-name">${course.display_name_with_default_escaped}</span>
<span class="provider">${course.display_org_with_default}:</span>
<span class="course-number">${course.display_number_with_default}</span>
<span class="course-name">${course.display_name_with_default}</span>
</h2>
% endif
......@@ -143,7 +144,12 @@ site_status_msg = get_site_status_msg(course_id)
</header>
% if course:
<!--[if lte IE 9]>
<div class="ie-banner" aria-hidden="true">${_('<strong>Warning:</strong> Your browser is not fully supported. We strongly recommend using {chrome_link} or {ff_link}.').format(chrome_link='<a href="https://www.google.com/chrome" target="_blank">Chrome</a>', ff_link='<a href="http://www.mozilla.org/firefox" target="_blank">Firefox</a>')}</div>
<div class="ie-banner" aria-hidden="true">${Text(_('{begin_strong}Warning:{end_strong} Your browser is not fully supported. We strongly recommend using {chrome_link} or {ff_link}.')).format(
begin_strong=HTML('<strong>'),
end_strong=HTML('</strong>'),
chrome_link=HTML('<a href="https://www.google.com/chrome" target="_blank">Chrome</a>'),
ff_link=HTML('<a href="http://www.mozilla.org/firefox" target="_blank">Firefox</a>'),
)}</div>
<![endif]-->
% endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment