Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fun-apps / templates / lms / main.html
Size: Mime:
## 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 django.utils.translation import get_language_bidi
from microsite_configuration import microsite
from microsite_configuration import page_title_breadcrumbs
from branding import api as branding_api
%>
<!DOCTYPE html>
<!--[if lte IE 9]><html class="ie ie9 lte9" lang="${LANGUAGE_CODE}"><![endif]-->
<!--[if !IE]><!-->
<html lang="${LANGUAGE_CODE}">
<!--<![endif]-->

<head dir="${static.dir_rtl()}">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    ## We override this template to:
    ## - insert the RSS feed
    ## - add the platform node name
    ## - remove the google-site-verification meta name
    <%! from django.core.urlresolvers import reverse %>
    <%! import platform %>
    <meta name="platform.node" CONTENT="${platform.node()}">
    <link rel="alternate" type="application/rss+xml" title="${_('FUN courses RSS feed')}" href="${reverse('fun-courses:feed')}" />

    ## 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">
      <title>
       ${page_title_breadcrumbs(self.pagetitle())}
      </title>
  </%block>

  % if not allow_iframing:
      <script type="text/javascript">
        /* immediately break out of an iframe if coming from the marketing website */
        (function (window) {
            if (window.location !== window.top.location) {
                window.top.location = window.location;
            }
        })(this);
    </script>
  % endif

  <script type="text/javascript" src="/i18n.js"></script>

  <link rel="icon" type="image/x-icon" href="${static.url(microsite.get_value('favicon_path', settings.FAVICON_PATH))}" />

  <%static:css group='style-vendor'/>
  ## We could do <%static:css group='style-main'/>, but that's only useful
  ## if the group contains multiple files, and the 'style-main' group doesn't.
  ## Instead, we'll construct this <link> element manually, to improve clarity.
  ## When nothing in the system is referencing the 'style-main' group, it can
  ## be removed from the environment file.
  <%
  application_css_path = "css/lms-main{rtl}.css".format(
    rtl="-rtl" if get_language_bidi() else "",
  )
  %>
    <link rel="stylesheet" href="${static.url(application_css_path)}" type="text/css" media="all" />

    % 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

  <script>
    window.baseUrl = "${settings.STATIC_URL}";
    (function (require) {
        require.config({
            baseUrl: window.baseUrl
        });
    }).call(this, require || RequireJS.require);
</script>
  <script type="text/javascript" src="${static.url("lms/js/require-config.js")}"></script>

  % if not disable_courseware_js:
    <%static:js group='module-js'/>
  % endif

  <%block name="headextra"/>

  <%static:optional_include_mako file="head-extra.html" with_microsite="True" />

  <%include file="widgets/optimizely.html" />
  <%include file="widgets/segment-io.html" />

  <meta name="path_prefix" content="${EDX_ROOT_URL}">

</head>

<body class="${static.dir_rtl()} <%block name='bodyclass'/> lang_${LANGUAGE_CODE}">
    <%static:optional_include_mako file="body-initial.html" with_microsite="True" />
<div id="page-prompt"></div>
% if not disable_window_wrap:
  <div class="window-wrap" dir="${static.dir_rtl()}">
% endif
    <a class="nav-skip" href="<%block name="nav_skip">#content</%block>">${_("Skip to main content")}</a>

    % if not disable_header:
        <%include file="${microsite.get_template_path('header.html')}" />
    % endif

    <div class="content-wrapper" id="content">
      ${self.body()}
      <%block name="bodyextra"/>
    </div>

    % if not disable_footer:
        <%include file="themable-footer.html" />
    % endif

% if not disable_window_wrap:
  </div>
% endif

  <%block name="js_extra"/>
  <%include file="widgets/segment-io-footer.html" />
  <script type="text/javascript" src="${static.url('js/vendor/noreferrer.js')}" charset="utf-8"></script>
  <script type="text/javascript" src="${static.url('js/utils/navigation.js')}" charset="utf-8"></script>

% if request.META and request.META.get("HTTP_HOST"):
  % if "fun-mooc.fr" in request.META["HTTP_HOST"]:
    <script  type="text/javascript" src="//tag.aticdn.net/602676/smarttag.js"></script>
  % else:
    <script  type="text/javascript" src="//tag.aticdn.net/602677/smarttag.js"></script>
  % endif
    <script type="text/javascript">
    if (window.ATInternet) {
      % if "fun-mooc.fr" in request.META["HTTP_HOST"]:
        var tag = new ATInternet.Tracker.Tag({ site: 602676 });
      % else:
        var tag = new ATInternet.Tracker.Tag({ site: 602677 });
      % endif
      tag.page.set({});
      tag.dispatch();
    }
    </script>
%endif

  <%static:optional_include_mako file="body-extra.html" with_microsite="True" />
</body>
</html>

<%def name="login_query()">${
  u"?next={0}".format(urlquote_plus(login_redirect_url)) if login_redirect_url else ""
}</%def>

<!-- Performance beacon for onload times -->
% if settings.FEATURES.get('ENABLE_ONLOAD_BEACON', False):
<script>
    (function () {
        var sample_rate = ${ settings.ONLOAD_BEACON_SAMPLE_RATE };
        var roll = Math.floor(Math.random() * 100) / 100;
        var onloadBeaconSent = false;

        if (roll < sample_rate) {
            $(window).load(function () {
                setTimeout(function () {
                    var t = window.performance.timing;

                    var data = {
                        event: "onload",
                        value: t.loadEventEnd - t.navigationStart,
                        page: window.location.href,
                    };

                    if (!onloadBeaconSent) {
                        $.ajax({ method: "POST", url: "/performance", data: data });
                    }
                    onloadBeaconSent = true;
                }, 0);
            });
        }
    }());
</script>
% endif