Commit ebf89d63 by Robert Raposa

Merge pull request #12541 from edx/robrap/fix-imports

Fix import order for HTML, Text.
parents e613b7f4 addb5bf6
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="base.html" /> <%inherit file="base.html" />
<%block name="title">${_("Page Not Found")}</%block> <%block name="title">${_("Page Not Found")}</%block>
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
%> %>
<%inherit file="base.html" /> <%inherit file="base.html" />
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<%! <%!
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json from openedx.core.djangolib.js_utils import js_escaped_string, dump_js_escaped_json
%> %>
<%block name="title">${_("Files & Uploads")}</%block> <%block name="title">${_("Files & Uploads")}</%block>
......
...@@ -15,7 +15,7 @@ from contentstore.views.helpers import xblock_studio_url, xblock_type_display_na ...@@ -15,7 +15,7 @@ from contentstore.views.helpers import xblock_studio_url, xblock_type_display_na
from openedx.core.djangolib.js_utils import ( from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string dump_js_escaped_json, js_escaped_string
) )
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%block name="title">${xblock.display_name_with_default} ${xblock_type_display_name(xblock)}</%block> <%block name="title">${xblock.display_name_with_default} ${xblock_type_display_name(xblock)}</%block>
......
...@@ -8,7 +8,7 @@ from django.utils.translation import ugettext as _ ...@@ -8,7 +8,7 @@ from django.utils.translation import ugettext as _
from openedx.core.djangolib.js_utils import dump_js_escaped_json from openedx.core.djangolib.js_utils import dump_js_escaped_json
from contentstore.utils import reverse_usage_url from contentstore.utils import reverse_usage_url
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%block name="title">${_("Course Outline")}</%block> <%block name="title">${_("Course Outline")}</%block>
<%block name="bodyclass">is-signedin course view-outline</%block> <%block name="bodyclass">is-signedin course view-outline</%block>
......
...@@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _ ...@@ -9,7 +9,7 @@ from django.utils.translation import ugettext as _
from openedx.core.djangolib.js_utils import ( from openedx.core.djangolib.js_utils import (
dump_js_escaped_json, js_escaped_string dump_js_escaped_json, js_escaped_string
) )
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%block name="title">${_("Group Configurations")}</%block> <%block name="title">${_("Group Configurations")}</%block>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="base.html" /> <%inherit file="base.html" />
......
...@@ -53,7 +53,7 @@ from class_dashboard.dashboard_data import get_section_display_name, get_array_s ...@@ -53,7 +53,7 @@ from class_dashboard.dashboard_data import get_section_display_name, get_array_s
from .tools import get_units_with_due_date, title_or_url from .tools import get_units_with_due_date, title_or_url
from opaque_keys.edx.locations import SlashSeparatedCourseKey from opaque_keys.edx.locations import SlashSeparatedCourseKey
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangoapps.api_admin.models import ApiAccessRequest from openedx.core.djangoapps.api_admin.models import ApiAccessRequest
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<div id="api-access-wrapper"> <div id="api-access-wrapper">
...@@ -45,7 +45,7 @@ from openedx.core.djangolib.markup import Text, HTML ...@@ -45,7 +45,7 @@ from openedx.core.djangolib.markup import Text, HTML
<div class="api-form-container"> <div class="api-form-container">
<form id="api-form-fields" method="post" class="api-form"> <form id="api-form-fields" method="post" class="api-form">
<input type="hidden" id="csrf_token" name="csrfmiddlewaretoken" value="${csrf_token}"> <input type="hidden" id="csrf_token" name="csrfmiddlewaretoken" value="${csrf_token}">
${form.as_p() | n} ${form.as_p() | n, decode.utf8}
<input id="api-access-submit" type="submit" value="${_('Generate API client credentials')}"/> <input id="api-access-submit" type="submit" value="${_('Generate API client credentials')}"/>
</form> </form>
</div> </div>
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<div class="batch-enrollment" style="float:left;width:50%"> <div class="batch-enrollment" style="float:left;width:50%">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
from util.date_utils import get_time_display from util.date_utils import get_time_display
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.conf import settings from django.conf import settings
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%def name="make_chapter(chapter)"> <%def name="make_chapter(chapter)">
......
...@@ -7,7 +7,7 @@ from django.utils.translation import ugettext as _ ...@@ -7,7 +7,7 @@ from django.utils.translation import ugettext as _
from courseware.courses import get_course_info_section, get_course_date_summary from courseware.courses import get_course_info_section, get_course_date_summary
from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%block name="pagetitle">${_("{course_number} Course Info").format(course_number=course.display_number_with_default)}</%block> <%block name="pagetitle">${_("{course_number} Course Info").format(course_number=course.display_number_with_default)}</%block>
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<h2>${chapter_module.display_name_with_default}</h2> <h2>${chapter_module.display_name_with_default}</h2>
......
...@@ -8,7 +8,7 @@ from django.template import RequestContext ...@@ -8,7 +8,7 @@ from django.template import RequestContext
import third_party_auth import third_party_auth
from third_party_auth import pipeline from third_party_auth import pipeline
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<% <%
...@@ -63,13 +63,13 @@ from openedx.core.djangolib.markup import Text, HTML ...@@ -63,13 +63,13 @@ from openedx.core.djangolib.markup import Text, HTML
<div class="dashboard-notifications" tabindex="-1"> <div class="dashboard-notifications" tabindex="-1">
%if message: %if message:
<section class="dashboard-banner"> <section class="dashboard-banner">
${message | n, unicode} ${message | n, decode.utf8}
</section> </section>
%endif %endif
%if enrollment_message: %if enrollment_message:
<section class="dashboard-banner"> <section class="dashboard-banner">
${enrollment_message | n, unicode} ${enrollment_message | n, decode.utf8}
</section> </section>
%endif %endif
</div> </div>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from course_modes.models import CourseMode from course_modes.models import CourseMode
%> %>
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
......
...@@ -9,7 +9,7 @@ from django.core.urlresolvers import reverse ...@@ -9,7 +9,7 @@ from django.core.urlresolvers import reverse
from course_modes.models import CourseMode from course_modes.models import CourseMode
from course_modes.helpers import enrollment_mode_display from course_modes.helpers import enrollment_mode_display
from openedx.core.djangolib.js_utils import dump_js_escaped_json from openedx.core.djangolib.js_utils import dump_js_escaped_json
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from student.helpers import ( from student.helpers import (
VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_NEED_TO_VERIFY,
VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_SUBMITTED,
......
<%page expression_filter="h" args="program_data, enrollment_mode, display_category" /> <%page expression_filter="h" args="program_data, enrollment_mode, display_category" />
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<div class="message message-status is-shown credit-message"> <div class="message message-status is-shown credit-message">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from edxnotes.helpers import NoteJSONEncoder from edxnotes.helpers import NoteJSONEncoder
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
%> %>
...@@ -113,7 +113,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str ...@@ -113,7 +113,7 @@ from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_str
<%static:require_module module_name="js/edxnotes/views/page_factory" class_name="NotesPageFactory"> <%static:require_module module_name="js/edxnotes/views/page_factory" class_name="NotesPageFactory">
NotesPageFactory({ NotesPageFactory({
disabledTabs: ${disabled_tabs | n, dump_js_escaped_json}, disabledTabs: ${disabled_tabs | n, dump_js_escaped_json},
notes: ${dump_js_escaped_json(notes, NoteJSONEncoder) | n}, notes: ${dump_js_escaped_json(notes, NoteJSONEncoder) | n, decode.utf8},
notesEndpoint: ${notes_endpoint | n, dump_js_escaped_json}, notesEndpoint: ${notes_endpoint | n, dump_js_escaped_json},
pageSize: ${page_size | n, dump_js_escaped_json}, pageSize: ${page_size | n, dump_js_escaped_json},
debugMode: ${debug | n, dump_js_escaped_json} debugMode: ${debug | n, dump_js_escaped_json}
......
...@@ -8,7 +8,7 @@ from django.conf import settings ...@@ -8,7 +8,7 @@ from django.conf import settings
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from openedx.core.djangolib.js_utils import js_escaped_string from openedx.core.djangolib.js_utils import js_escaped_string
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from xmodule.tabs import CourseTabList from xmodule.tabs import CourseTabList
%> %>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<main id="main" aria-label="Content" tabindex="-1"> <main id="main" aria-label="Content" tabindex="-1">
...@@ -15,7 +15,7 @@ from openedx.core.djangolib.markup import Text, HTML ...@@ -15,7 +15,7 @@ from openedx.core.djangolib.markup import Text, HTML
<div class="title"> <div class="title">
<div class="heading-group"> <div class="heading-group">
% if homepage_overlay_html: % if homepage_overlay_html:
${homepage_overlay_html|n} ${homepage_overlay_html | n, decode.utf8}
% else: % else:
## Translators: 'Open edX' is a registered trademark, please keep this untranslated. See http://open.edx.org for more information. ## Translators: 'Open edX' is a registered trademark, please keep this untranslated. See http://open.edx.org for more information.
<h1>${Text(_(u"Welcome to the Open edX{registered_trademark} platform!")).format(registered_trademark=HTML("<sup style='font-size: 65%'>&reg;</sup>"))}</h1> <h1>${Text(_(u"Welcome to the Open edX{registered_trademark} platform!")).format(registered_trademark=HTML("<sup style='font-size: 65%'>&reg;</sup>"))}</h1>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from provider.templatetags.scope import scopes from provider.templatetags.scope import scopes
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html"/> <%inherit file="../main.html"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html"/> <%inherit file="../main.html"/>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html"/> <%inherit file="../main.html"/>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<%inherit file="../main.html" /> <%inherit file="../main.html" />
......
<%page expression_filter="h"/> <%page expression_filter="h"/>
<%! <%!
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.conf import settings from django.conf import settings
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import json import json
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
from lms.djangoapps.verify_student.views import PayAndVerifyView from lms.djangoapps.verify_student.views import PayAndVerifyView
%> %>
<%namespace name='static' file='../static_content.html'/> <%namespace name='static' file='../static_content.html'/>
......
...@@ -23,7 +23,7 @@ def HTML(html): # pylint: disable=invalid-name ...@@ -23,7 +23,7 @@ def HTML(html): # pylint: disable=invalid-name
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
${Text(_("Write & send {start}email{end}")).format( ${Text(_("Write & send {start}email{end}")).format(
start=HTML("<a href='mailto:{}'>").format(user.email), start=HTML("<a href='mailto:{}'>").format(user.email),
......
...@@ -10,7 +10,7 @@ import ddt ...@@ -10,7 +10,7 @@ import ddt
from django.utils.translation import ugettext as _, ungettext from django.utils.translation import ugettext as _, ungettext
from mako.template import Template from mako.template import Template
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
@attr('shard_2') @attr('shard_2')
...@@ -60,7 +60,7 @@ class FormatHtmlTest(unittest.TestCase): ...@@ -60,7 +60,7 @@ class FormatHtmlTest(unittest.TestCase):
<%! <%!
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
${Text(_(u"A & {BC}")).format(BC=HTML("B & C"))} ${Text(_(u"A & {BC}")).format(BC=HTML("B & C"))}
""", """,
......
...@@ -10,7 +10,7 @@ from microsite_configuration import microsite ...@@ -10,7 +10,7 @@ from microsite_configuration import microsite
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
import json import json
from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string
from openedx.core.djangolib.markup import Text, HTML from openedx.core.djangolib.markup import HTML, Text
%> %>
<% <%
...@@ -65,13 +65,13 @@ from openedx.core.djangolib.markup import Text, HTML ...@@ -65,13 +65,13 @@ from openedx.core.djangolib.markup import Text, HTML
<div class="dashboard-notifications" tabindex="-1"> <div class="dashboard-notifications" tabindex="-1">
%if message: %if message:
<section class="dashboard-banner"> <section class="dashboard-banner">
${message | n, unicode} ${message | n, decode.utf8}
</section> </section>
%endif %endif
%if enrollment_message: %if enrollment_message:
<section class="dashboard-banner"> <section class="dashboard-banner">
${enrollment_message | n, unicode} ${enrollment_message | n, decode.utf8}
</section> </section>
%endif %endif
</div> </div>
......
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