<%! from django.utils.translation import ugettext as _ %> <%namespace name='static' file='static_content.html'/> <%! from django.utils import html %> ## 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. <%def name="theme_enabled()"> <% return settings.FEATURES.get("USE_CUSTOM_THEME", False) %> <%def name="stanford_theme_enabled()"> <% return theme_enabled() and getattr(settings, "THEME_NAME") == "stanford" %> <%block name="title"> % if stanford_theme_enabled(): ${_("Home")} | class.stanford.edu % else: ## "edX" should not be translated edX % endif <%static:css group='style-vendor'/> <%static:css group='style-app'/> <%static:css group='style-app-extend1'/> <%static:css group='style-app-extend2'/> <%static:js group='main_vendor'/> <%block name="headextra"/> % if theme_enabled(): <%include file="theme-head-extra.html" /> % endif % if not course: % if theme_enabled(): <%include file="theme-google-analytics.html" /> % else: <%include file="google_analytics.html" /> % endif % endif <%include file="widgets/segment-io.html" /> ${_("Skip to this view's content")} <%include file="mathjax_accessible.html" /> % if theme_enabled(): <%include file="theme-header.html" /> % elif not suppress_toplevel_navigation: <%include file="navigation.html" /> % endif
${self.body()} <%block name="bodyextra"/>
% if theme_enabled(): <%include file="theme-footer.html" /> % elif not suppress_toplevel_navigation: <%include file="footer.html" /> % endif <%static:js group='application'/> <%static:js group='module-js'/> <%block name="js_extra"/> <%def name="login_query()">${ "?course_id={0}&enrollment_action={1}".format( html.escape(course_id), html.escape(enrollment_action) ) if course_id and enrollment_action else "" }