{# Base template for edX-specific pages. #}

{% load compress %}
{% load core_extras %}
{% load i18n %}
{% load staticfiles %}

<!DOCTYPE html>
<html lang={{ LANGUAGE_CODE }}>
<head>
    <link rel="shortcut icon" href="{% static 'images/favicon.ico' %}"/>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}{% endblock title %}</title>

    {% compress css %}
        {% if main_css %}
            <link rel="stylesheet" href="{{ main_css }}" type="text/x-scss">
        {% else %}
            <link rel="stylesheet" href="{% static 'css/base/main.css' %}" type="text/x-scss">
        {% endif %}
    {% endcompress %}

    {% compress css %}
        {# This block is separated to better support browser caching. #}
        {% block stylesheets %}
        {% endblock %}
    {% endcompress %}

    {% if optimizely_snippet_src %}
      <script src="{{ optimizely_snippet_src }}"></script>
    {% endif %}
</head>
<body>
{% block skip_link %}
{% endblock skip_link %}

{% block navbar %}
    {% include 'edx/partials/_staff_navbar.html' %}
{% endblock navbar %}

{% block info_message %}
    {% include 'edx/partials/_info_message.html' %}
{% endblock info_message %}

{% block content %}
{% endblock content %}

{% block footer %}
  {% include 'edx/footer.html' %}
{% endblock footer %}

{# Translation support for JavaScript strings. #}
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>

<script type="text/javascript">
    var initModelData = {{ analytics_data|safe }};
</script>

{% compress js %}
    <script src="{% static 'bower_components/requirejs/require.js' %}"></script>
    <script src="{% static 'js/config.js' %}"></script>

    {# Note: django-compressor does not recognize the data-main attribute. Load the main script separately. #}
    <script src="{% static 'js/common.js' %}"></script>
{% endcompress %}

{% compress js %}
    {# Note: This block is purposely separated from the one above so that browsers cache the common JS instead of
    downloading a single, large file for each page. #}
    {% block javascript %}
    {% endblock javascript %}
{% endcompress %}

{% block post_js %}
{% endblock %}
</body>
</html>
