base.html 4.1 KB
Newer Older
1
## -*- coding: utf-8 -*-
2 3 4 5 6
<%!
from django.utils.translation import ugettext as _
from django.template.defaultfilters import escapejs
import json
%>
7 8
<%namespace name='static' file='static_content.html'/>

9
<!doctype html>
10 11 12 13
<!--[if IE 7]><html class="ie7 lte9 lte8 lte7" lang="${LANGUAGE_CODE}"><![endif]-->
<!--[if IE 8]><html class="ie8 lte9 lte8" lang="${LANGUAGE_CODE}"><![endif]-->
<!--[if IE 9]><html class="ie9 lte9" lang="${LANGUAGE_CODE}"><![endif]-->
<!--[if gt IE 9]><!--><html lang="${LANGUAGE_CODE}"><!--<![endif]-->
14
<%
15
    # set doc language direction
16 17 18 19
    from django.utils.translation import get_language_bidi
    dir_rtl = 'rtl' if get_language_bidi() else 'ltr'
%>
  <head dir="${dir_rtl}">
20 21
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
22
    <title>
23
        <%block name="title"></%block> |
24 25
        % if context_course:
        <% ctx_loc = context_course.location %>
26
        ${context_course.display_name_with_default | h} |
27 28
        % elif context_library:
        ${context_library.display_name_with_default | h} |
29
        % endif
30
        ${settings.STUDIO_NAME}
31
    </title>
32 33

    <meta name="viewport" content="width=device-width,initial-scale=1">
34
    <meta name="path_prefix" content="${EDX_ROOT_URL}">
35

36
    <%static:css group='style-vendor'/>
37 38
    <%static:css group='style-vendor-tinymce-content'/>
    <%static:css group='style-vendor-tinymce-skin'/>
39
    <%static:css group='style-app'/>
40
    <%static:css group='style-app-extend1'/>
41
    <%static:css group='style-xmodule'/>
42

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

45
    <%block name="header_extras"></%block>
46 47
  </head>

48
  <body class="${dir_rtl} <%block name='bodyclass'></%block> lang_${LANGUAGE_CODE}">
49 50
  <%block name="view_notes"></%block>

51
    <a class="nav-skip" href="#content">${_("Skip to this view's content")}</a>
52

53
    <script type="text/javascript">
54 55
      window.baseUrl = ${json.dumps(settings.STATIC_URL)};
      window.TENDER_DOMAIN = ${json.dumps(settings.TENDER_DOMAIN)};
56
      var require = {baseUrl: window.baseUrl};
57 58
    </script>
    <script type="text/javascript" src="${static.url("js/vendor/require.js")}"></script>
59
    <script type="text/javascript" src="${static.url("require-config.js")}"></script>
60

61 62 63 64
    ## js templates
    <script id="system-feedback-tpl" type="text/template">
      <%static:include path="js/system-feedback.underscore" />
    </script>
65

66
    <!-- view -->
67
    <div class="wrapper wrapper-view" dir="${dir_rtl}">
68 69
        <% online_help_token = self.online_help_token() if hasattr(self, 'online_help_token') else None %>
        <%include file="widgets/header.html" args="online_help_token=online_help_token" />
70

Mathew Peterson committed
71 72 73
      <div id="page-alert">
      <%block name="page_alert"></%block>
      </div>
74

75
      <div id="content">
76
      <%block name="content"></%block>
77
      </div>
78 79

      % if user.is_authenticated():
80
        <%include file="widgets/sock.html" args="online_help_token=online_help_token" />
81
      % endif
82
      <%include file="widgets/footer.html" />
David Baumgold committed
83
      <%include file="widgets/tender.html" />
84

85
      <div id="page-notification"></div>
86
    </div>
87

88
    <div id="page-prompt"></div>
89
    <%block name="jsextra"></%block>
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
    <script type="text/javascript">
      require(['js/factories/common_deps'], function () {
          require(['js/factories/base'], function () {
            % if context_course:
              require(['js/factories/course'], function(CourseFactory) {
                  CourseFactory({
                      id: "${context_course.id | escapejs}",
                      name: "${context_course.display_name_with_default | h}",
                      url_name: "${context_course.location.name | h}",
                      org: "${context_course.location.org | h}",
                      num: "${context_course.location.course | h}",
                      revision: "${context_course.location.revision | h}"
                  });
              });
            % endif
            % if user.is_authenticated():
                require(['js/sock']);
            % endif
            <%block name='requirejs'></%block>
          });
      });
    </script>
112
    <div class="modal-cover"></div>
113 114
  </body>
</html>