## coding=utf-8 ## This is the main Mako template that all page templates should include. ## Note: there are a handful of pages that use Django Templates and which ## instead include main_django.html. It is important that these two files ## remain in sync, so changes made in one should be applied to the other. ## Pages currently use v1 styling by default. Once the Pattern Library ## rollout has been completed, this default can be switched to v2. <%page expression_filter="h"/> <%! main_css = "style-main-v1" %> <%namespace name='static' file='static_content.html'/> <% online_help_token = self.online_help_token() if hasattr(self, 'online_help_token') else None %> <%! import six from lms.djangoapps.branding import api as branding_api from django.urls import reverse from django.utils.http import urlquote_plus from django.utils.translation import ugettext as _ from django.utils.translation import get_language_bidi from lms.djangoapps.courseware.access import has_access from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers from openedx.core.djangolib.js_utils import dump_js_escaped_json, js_escaped_string from openedx.core.release import RELEASE_LINE from common.djangoapps.pipeline_mako import render_require_js_path_overrides %> ## Define a couple of helper functions to make life easier when ## embedding theme conditionals into templates. All inheriting ## templates have access to these functions, and we can import these ## into non-inheriting templates via the %namespace tag. ## this needs to be here to prevent the title from mysteriously appearing in the body, in one case <%def name="pagetitle()" /> <%block name="title"> ${static.get_page_title_breadcrumbs(self.pagetitle())} % if not allow_iframing: % endif <% jsi18n_path = "js/i18n/{language}/djangojs.js".format(language=LANGUAGE_CODE) ie11_fix_path = "js/ie11_find_array.js" %> % if getattr(settings, 'CAPTURE_CONSOLE_LOG', False): % endif <% favicon_url = branding_api.get_favicon_url() %> <%static:css group='style-vendor'/> % if '/' in self.attr.main_css: % if get_language_bidi(): <% rtl_css_file = self.attr.main_css.replace('.css', '-rtl.css') %> % else: % endif % else: <%static:css group='${self.attr.main_css}'/> % endif % if disable_courseware_js: <%static:js group='base_vendor'/> <%static:js group='base_application'/> % else: <%static:js group='main_vendor'/> <%static:js group='application'/> % endif <%static:webpack entry="commons"/> % if uses_bootstrap: ## xss-lint: disable=mako-invalid-js-filter % endif <%block name="js_overrides"> ${render_require_js_path_overrides(settings.REQUIRE_JS_PATH_OVERRIDES) | n, decode.utf8} <%block name="headextra"/> <%block name="head_extra"/> <%include file="/courseware/experiments.html"/> <%include file="/experiments/user_metadata.html"/> <%static:optional_include_mako file="head-extra.html" is_theming_enabled="True" /> <%include file="widgets/optimizely.html" /> <%include file="widgets/segment-io.html" /> <% google_site_verification_id = configuration_helpers.get_value('GOOGLE_SITE_VERIFICATION_ID', settings.GOOGLE_SITE_VERIFICATION_ID) %> % if google_site_verification_id: % endif <% ga_acct = static.get_value("GOOGLE_ANALYTICS_ACCOUNT", settings.GOOGLE_ANALYTICS_ACCOUNT) %> % if ga_acct: % endif <% branch_key = static.get_value("BRANCH_IO_KEY", settings.BRANCH_IO_KEY) %> % if branch_key and not is_from_mobile_app: % endif <%static:optional_include_mako file="body-initial.html" is_theming_enabled="True" />
% if not disable_window_wrap:
% endif <%block name="skip_links"/> ${_("Skip to main content")} % if not disable_header: <%include file="${static.get_template_path('header.html')}" args="online_help_token=online_help_token" /> <%include file="/preview_menu.html" /> % endif <%include file="/page_banner.html" />
<%block name="marketing_hero">
${self.body()} <%block name="bodyextra"/>
% if not disable_footer: <%include file="${static.get_template_path('footer.html')}" /> % endif % if not disable_window_wrap:
% endif <%block name="footer_extra"/> <%block name="js_extra"/> <%include file="widgets/segment-io-footer.html" /> <%static:optional_include_mako file="body-extra.html" is_theming_enabled="True" />
<%def name="login_query()">${ u"?next={next}".format( next=urlquote_plus(login_redirect_url if login_redirect_url else request.path) ) if (login_redirect_url or (request and not request.path.startswith("/logout"))) else "" }