{% from "includes/common_macros.html" import optimizely_script with context %}
<!DOCTYPE html>
<html lang="{{ LANG }}" dir="{{ DIR }}" class="redesign no-js">
<head prefix="og: http://ogp.me/ns#">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge">
  <script>(function(d) { d.className = d.className.replace(/\bno-js/, ''); })(document.documentElement);</script>
  {% if not is_sphinx %}
    {{ optimizely_script() }}
  {% endif %}
  <title>{% block title %}{{ _('Mozilla Developer Network') }}{% endblock %}</title>

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="robots" content="{% block robots_value%}index, follow{% endblock %}">
  <link rel="home" href="{{ url('home') }}">
  <link rel="copyright" href="#copyright">

  <link href="//mozorg.cdn.mozilla.net/media/css/tabzilla-min.css" type="text/css" rel="stylesheet">
  {% block site_css %}
    {{ css('mdn', 'all') }}

    {% for style in styles %}
      {{ css(style) }}
    {% endfor %}
  {% endblock %}

  <!-- common social tags -->
  {% set social_logo = request.build_absolute_uri('/media/redesign/img/opengraph-logo.png') %}
  <meta property="og:type" content="website">
  <meta property="og:image" content="{{ social_logo }}">
  <meta property="og:site_name" content="{{ _('Mozilla Developer Network') }}">
  <meta name="twitter:card" content="summary">
  <meta name="twitter:image" content="{{ social_logo }}">
  <meta name="twitter:site" content="@NewOnMDN">
  <meta name="twitter:creator" content="@NewOnMDN">

  <link rel="search" type="application/opensearchdescription+xml" href="{{ settings.SITE_URL }}/{{ request.locale }}/search/xml" title="{{ _('Mozilla Developer Network') }}">

  <!-- third-generation iPad with high-resolution Retina display: -->
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ MEDIA_URL }}redesign/img/favicon144.png">
  <!-- iPhone with high-resolution Retina display: -->
  <link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ MEDIA_URL }}redesign/img/favicon114.png">
  <!-- first- and second-generation iPad: -->
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ MEDIA_URL }}redesign/img/favicon72.png">
  <!-- non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
  <link rel="apple-touch-icon-precomposed" href="{{ MEDIA_URL }}redesign/img/favicon57.png">
  <!-- basic favicon -->
  {% if request.META.SERVER_NAME in settings.PRODUCTION_URL %}
    {% set favicon_suffix = '' %}
  {% elif request.META.SERVER_NAME in settings.STAGING_URL %}
    {% set favicon_suffix = '-staging' %}
  {% else %}
    {% set favicon_suffix = '-local' %}
  {% endif %}
  <link rel="shortcut icon" href="{{ MEDIA_URL }}redesign/img/favicon32{{ favicon_suffix }}.png">
  <!--[if IE]>
  <meta http-equiv="imagetoolbar" content="no">
  <script src="{{ MEDIA_URL }}js/libs/html5.js"></script>
  <![endif]-->

  {% block extrahead %}{% endblock %}

  {% if not is_sphinx %}
    {% include "includes/google_analytics.html" %}
  {% endif %}
</head>
<body {% block body_attributes %}{% endblock %} class="{% block bodyclass %}{% endblock %}"{% if request.user.is_authenticated() %} data-login-service="{{ request.session.sociallogin_provider }}"{% endif %}>

  {% include "includes/config.html" %}

  {{ soapbox_messages(get_soapbox_messages(request.path)) }}

  {% if waffle.flag('github_beta_notice') %}
    <div class="global-notice">
      <div class="wrap center">
          <p><bdi>Help us <a href="https://wiki.mozilla.org/MDN/Development/GitHub_Beta">test GitHub Sign-in</a> on our stage server.</bdi></p>
      </div>
    </div>
  {% endif %}


  {% if waffle.flag('badger') %}
    {% include "badger/includes/recent_badge_awards.html" %}
  {% endif %}

  <ul id="nav-access">
    <li><a href="#{% block main_content_id %}content{% endblock %}" id="skip-main">{{ _('Skip to main content') }}</a></li>
    <li><a id="skip-language" href="#language">{{ _('Select language') }}</a></li>
    {% if not is_sphinx %}
      <li><a href="#q" id="skip-search">{{ _('Skip to search') }}</a></li>
    {% endif %}
  </ul>

  <!-- Header -->
  <header id="main-header"><div class="center">

    <a href="//www.mozilla.org/" id="tabzilla" class="no-track">mozilla</a>

    <div class="clear header-clear"></div>

    <a href="{{ url('home') }}" class="logo">{{ _('Mozilla Developer Network') }}</a>

    <div class="header-login">
        {% if not is_sphinx %}
            {% include "includes/login.html" %}
        {% endif %}
    </div>

    <nav id="main-nav" role="navigation"><ul><li><a href="{{ devmo_url('Zones') }}">{{ _('Zones') }}<i aria-hidden="true" class="icon-caret-down"></i></a>

        <div class="submenu submenu-single" id="nav-zones-submenu">
          <div class="submenu-column">
            <ul>
              <li><a href="{{ devmo_url('Mozilla/Add-ons') }}">{{ _('Add-ons') }}</a></li>
              <li><a href="{{ devmo_url('Apps') }}">{{ _('App Center') }}</a></li>
              <li><a href="{{ devmo_url('Firefox') }}">{{ _('Firefox') }}</a></li>
              <li><a href="{{ devmo_url('Mozilla/Marketplace') }}">{{ _('Firefox Marketplace') }}</a></li>
              <li><a href="{{ devmo_url('Firefox_OS') }}">{{ _('Firefox OS') }}</a></li>
              <li><a href="{{ devmo_url('Persona') }}">{{ _('Persona') }}</a></li>
            </ul>
          </div>
        </div>
      </li><li><a href="{{ devmo_url('Web') }}">{{ _('Web Platform') }}<i aria-hidden="true" class="icon-caret-down"></i></a>

        <div class="submenu" id="nav-platform-submenu">
          <div class="submenu-column">
            <div class="title">{{ _('Technologies') }}</div>
            <ul>
              <li><a href="{{ devmo_url('Web/HTML') }}">{{ _('HTML') }}</a></li>
              <li><a href="{{ devmo_url('Web/CSS') }}">{{ _('CSS') }}</a></li>
              <li><a href="{{ devmo_url('Web/JavaScript') }}">{{ _('JavaScript') }}</a></li>
              <li><a href="{{ devmo_url('Web/Guide/Graphics') }}">{{ _('Graphics') }}</a></li>
              <li><a href="{{ devmo_url('Web/API') }}">{{ _('APIs / DOM') }}</a></li>
              <li><a href="{{ devmo_url('Web/Apps') }}">{{ _('Apps') }}</a></li>
              <li><a href="{{ devmo_url('Web/MathML') }}">{{ _('MathML') }}</a></li>
            </ul>
          </div><div class="submenu-column last">
            <div class="title">{{ _('References & Guides') }}</div>
            <ul>
              <li><a href="{{ devmo_url('Web/Tutorials') }}">{{ _('Tutorials') }}</a></li>
              <li><a href="{{ devmo_url('Web/Reference') }}">{{ _('References') }}</a></li>
              <li><a href="{{ devmo_url('Web/Guide') }}">{{ _('Developer Guides') }}</a></li>
              <li><a href="{{ devmo_url('Web/Accessibility') }}">{{ _('Accessibility') }}</a></li>
              <li><a href="{{ url('demos') }}">{{ _('Demos') }}</a></li>
              <li><a href="{{ devmo_url('Web') }}">{{ _('...more docs') }}</a></li>
            </ul>
          </div>
        </div>
      </li><li><a href="{{ devmo_url('Tools') }}">{{ _('Tools') }}</a></li><li><a href="{{ url('demos') }}">{{ _('Demos') }}</a></li><li><a href="{{ devmo_url('Mozilla/Connect') }}">{{ _('Connect') }}</a></li>{% if not is_sphinx %}<li class="main-nav-search"><form action="{{ url('search') }}" method="get" role="search">
        <div class="search-wrap">
          <label for="main-q" class="offscreen">{{ _('Search') }}</label>
          <input type="search" id="main-q" name="q" data-placeholder="{{ _('Search') }}" data-value="{{ query }}" value="" />
          <span class="search-trigger"><i aria-hidden="true" class="icon-search"></i></span>&nbsp;
          <button type="submit" class="offscreen">{{ _('Search') }}</button>
        </div>
      </form></li>{% endif %}</ul></nav>
  </div></header>

  <!-- Content will go here -->
  <main id="content"><div class="center clear">
  {% block content %}{% endblock %}
  </div></main>

  <!-- Footer -->
  <footer><div class="center">
    <div class="column-container">
      <div class="column-main">
        {% block footer_copyright_redesign %}
        <p>
          {% trans copyright_url=devmo_url('Project:MDN/About#Copyrights_and_licenses'), about_url=devmo_url('Project:MDN/About'), thisyear=thisyear() %}
          <bdi>&copy; 2005-{{ thisyear }} Mozilla Developer Network and individual contributors<br />
          Content is available under <a href="{{ copyright_url }}">these licenses</a> &middot; <a href="{{ about_url }}">About MDN</a> &middot; <a href="//github.com/mozilla/kuma">Contribute to the code</a> &middot; <a href="//www.mozilla.org/privacy/websites/">Privacy policy</a></bdi>
          {% endtrans %}
        </p>
        {% endblock %}
      </div>
      <div class="column-strip">
        {% if not is_sphinx %}
          {% block lang_switcher %}
              {% include "includes/lang_switcher.html" %}
          {% endblock %}
        {% endif %}
      </div>
    </div>
  </div></footer>

  <!-- site js -->
  {% if not waffle.flag('static-i18njs') %}
  <script src="{{ url('jsi18n') }}build:{{ BUILD_ID_JS }}"></script>
  {% endif %}

  {% block site_js %}
    <!--[if lte IE 8]><script src="/media/redesign/js/libs/selectivizr-1.0.2/selectivizr-build.js"></script><![endif]-->

    {{ providers_media_js() }}
    {{ js('main') }}

    {% if waffle.flag('ga_outbound_links') %}
      <script>
        mdn.analytics.trackOutboundLinks();
      </script>
    {% endif %}

    {% for script in scripts %}
      {{ js(script) }}
    {% endfor %}
  {% endblock %}

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