## 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.
<%! main_css = "style-main-v1" %>
<%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 django.utils.translation import get_language_bidi
from branding import api as branding_api
from 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())}
%block>
% if not allow_iframing:
% endif
<%
jsi18n_path = "js/i18n/{language}/djangojs.js".format(language=LANGUAGE_CODE)
%>
<%static:css group='style-vendor'/>
<%static:css group='${self.attr.main_css}'/>
% if not uses_pattern_library:
% 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
% else:
## TODO: Update to only bring in RequireJS
## https://openedx.atlassian.net/browse/FEDX-140
<%static:js group='base_vendor'/>
<%static:js group='base_application'/>
% endif
<%block name="js_overrides">
${render_require_js_path_overrides(settings.REQUIRE_JS_PATH_OVERRIDES)}
%block>
% if not disable_courseware_js:
<%static:js group='module-js'/>
% endif
<%block name="headextra"/>
<%static:optional_include_mako file="head-extra.html" is_theming_enabled="True" />
<%include file="widgets/optimizely.html" />
<%include file="widgets/segment-io.html" />
<% ga_acct = static.get_value("GOOGLE_ANALYTICS_ACCOUNT", settings.GOOGLE_ANALYTICS_ACCOUNT) %>
% if ga_acct:
% endif
<%static:optional_include_mako file="body-initial.html" is_theming_enabled="True" />
% if not disable_window_wrap:
% endif
${_("Skip to main content")}
% if not disable_header:
<%include file="${static.get_template_path('header.html')}" />
% endif
${self.body()}
<%block name="bodyextra"/>
% if not disable_footer:
<%include file="themable-footer.html" />
% endif
% if not disable_window_wrap: