{% load dfp_tags foundry_tags i18n compress jmbo_analytics_tags %}

{% if not request.render_only_content_block %}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta property="og:site_name" content="{{ CURRENT_SITE.title }}" />
    {% block extrameta %}
    <meta name="description" content="{% if SITE_DESCRIPTION %}{{ SITE_DESCRIPTION }}{% else %}Jmbo is a mobile-focused content delivery platform for the delivery of dynamic experiences to audiences in emerging markets.{% endif %}" />
    <meta property="og:title" content="{{ CURRENT_SITE.title }}" />
    <meta property="og:image" content="http{% if request.is_secure %}s{%endif %}://{{ request.META.HTTP_HOST }}{{ STATIC_URL }}images/logo.png" />
    <meta property="og:description" content="{% if SITE_DESCRIPTION %}{{ SITE_DESCRIPTION }}{% else %}Jmbo is a mobile-focused content delivery platform for the delivery of dynamic experiences to audiences in emerging markets.{% endif %}" />
    {% endblock %}
    <title>{{ CURRENT_SITE.title }}{% block extratitle %}{% endblock %}</title>
    {% compress css %}
    <link href="{{ STATIC_URL }}css/main.css" rel="stylesheet" type="text/css" />
    <link href="{{ STATIC_URL }}css/tile.css" rel="stylesheet" type="text/css" />
    <link href="{{ STATIC_URL }}css/comment.css" rel="stylesheet" type="text/css" />
    <link href="{{ STATIC_URL }}css/forms.css" rel="stylesheet" type="text/css" />
    {% if FOUNDRY_HAS_GALLERY %}
        <link href="{{ STATIC_URL }}gallery/css/gallery.css" rel="stylesheet" type="text/css" />
    {% endif %}
    <link href="{{ STATIC_URL }}css/promo.css" rel="stylesheet" type="text/css" />
    <link href="{{ STATIC_URL }}css/socialauth.css" rel="stylesheet" type="text/css" />
    <link href="{{ STATIC_URL }}css/custom.css" rel="stylesheet" type="text/css" />
    {% endcompress %}
    <link rel="shortcut icon" href="{{ STATIC_URL }}images/favicon.ico" />
    <script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.10.2.min.js"></script>
    {% compress js %}
    <script src="{{ STATIC_URL }}js/foundry.js" type="text/javascript"></script>
    {% if FOUNDRY_HAS_GALLERY %}
        <script src="{{ STATIC_URL }}gallery/js/gallery.js" type="text/javascript"></script>
    {% endif %}
    {% if FOUNDRY_HAS_BANNER %}
        <script src="{{ STATIC_URL }}banner/js/banner.js" type="text/javascript"></script>
    {% endif %}
    <script src="{{ STATIC_URL }}js/promo.js" type="text/javascript"></script>
    <script src="{{ STATIC_URL }}js/custom.js" type="text/javascript"></script>
    {% endcompress %}
    {% block extra-head %}
    {% endblock %}
</head>

<body>

    {% block header %}
        {% rows 'header' %}
    {% endblock %}

    <div id="message">
    {% block message %}
        {% if messages %}
            <ul class="messagelist">
                {% for message in messages %}<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>{% endfor %}
            </ul>
        {% endif %}
    {% endblock %}
    </div>

    <div id="content">
{% endif %}

        {% block content %}
        <div id="page-content">
        {% block page_content %}
            {% rows 'content' %}
        {% endblock %}
        </div>
        {% endblock %}

{% if not request.render_only_content_block %}
    </div>

    {% block footer %}
        {% rows 'footer' %}
    {% endblock %}

    {% if ANALYTICS_TAGS %}
        {{ ANALYTICS_TAGS|safe }}
    {% endif %}

    <noscript>
        <img src="{% google_analytics %}" width="0" height="0" rel="nofollow" />
    </noscript>

    {% dfp_footer %}
</body>
</html>
{% endif %}
