## coding=utf-8
<%namespace name='static' file='static_content.html'/>
<%!
from django.core.urlresolvers import reverse
from django.utils.http import urlquote_plus
from django.utils.translation import ugettext as _
from microsite_configuration import microsite
from microsite_configuration import page_title_breadcrumbs
from branding import api as branding_api
%>
% if responsive:
% endif
## 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>
<%def name="is_microsite()">
<% return microsite.is_request_in_microsite() %>
%def>
<%def name="stanford_theme_enabled()">
<%
if not theme_enabled():
return False
return getattr(settings, "THEME_NAME", None) == "stanford"
%>
%def>
## this needs to be here to prevent the title from mysteriously appearing in the body, in one case
<%def name="pagetitle()" />
<%block name="title">
${page_title_breadcrumbs(self.pagetitle())}
%block>
% if not allow_iframing:
% endif
<%static:css group='style-vendor'/>
<%static:css group='style-main'/>
% if disable_courseware_js:
<%static:js group='base_vendor'/>
% else:
<%static:js group='main_vendor'/>
% endif
<%block name="headextra"/>
<%
if theme_enabled() and not is_microsite():
header_extra_file = 'theme-head-extra.html'
header_file = 'theme-header.html'
google_analytics_file = 'theme-google-analytics.html'
style_overrides_file = None
else:
header_extra_file = None
if settings.FEATURES['IS_EDX_DOMAIN'] and not is_microsite():
header_file = microsite.get_template_path('navigation-edx.html')
else:
header_file = microsite.get_template_path('navigation.html')
google_analytics_file = microsite.get_template_path('google_analytics.html')
style_overrides_file = microsite.get_value('css_overrides_file')
%>
% if header_extra_file:
<%include file="${header_extra_file}" />
% endif
<%include file="widgets/optimizely.html" />
<%include file="widgets/segment-io.html" />
<%include file="${google_analytics_file}" />
% if style_overrides_file:
% endif
% if not disable_window_wrap:
% if not disable_footer:
<%block name="footer">
## Can be overridden by child templates wanting to hide the footer.
% if theme_enabled() and not is_microsite():
<%include file="theme-footer.html" />
% elif settings.FEATURES.get('IS_EDX_DOMAIN', False) and not is_microsite():
## TODO (ECOM-1339): Remove this check to permanently enable the V3 footer.
% if branding_api.is_enabled():
<%include file="footer-edx-v3.html" />
% else:
<%include file="footer-edx-v2.html" />
% endif
% else:
<%include file="${microsite.get_template_path('footer.html')}" />
% endif
%block>
% endif
% if not disable_window_wrap:
% endif
% if not disable_courseware_js:
<%static:js group='application'/>
<%static:js group='module-js'/>
% endif
<%block name="js_extra"/>
<%def name="login_query()">${
u"?course_id={0}&enrollment_action={1}{course_mode}{email_opt_in}".format(
urlquote_plus(course_id),
urlquote_plus(enrollment_action),
course_mode=(
u"&course_mode=" + urlquote_plus(course_mode)
if course_mode else ""
),
email_opt_in=(
u"&email_opt_in=" + urlquote_plus(email_opt_in)
if email_opt_in else ""
)
) if course_id and enrollment_action else ""
}%def>
% if settings.FEATURES.get('ENABLE_ONLOAD_BEACON', False):
% endif