<!DOCTYPE html>
{% load perm_tags %}
{# admin left for deprecation for custom templates/themes #}
{% is_admin request.user as admin %}
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" dir="ltr" lang="en-US"> 
 
<head profile="http://gmpg.org/xfn/11">{{ NEW_RELIC_HEADER|safe }}
    {% block full_title %}<title>{% block title %}{% endblock %} {{ SITE_GLOBAL_SITEDISPLAYNAME }}</title>{% endblock %}
    <meta charset="UTF-8">
    {% block full_meta_description %}<meta name="description" content="{% block meta_description %}{% endblock %}" />{% endblock %}
    {% block full_meta_keywords %}<meta name="keywords" content="{% block meta_keywords %}{% endblock %}" />{% endblock %}
    <meta name="generator" content="Tendenci 5.1" /> 

    <link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/" />
    {% block meta_canonical_url %}{% endblock %}
    <link href="{{ STATIC_URL }}css/global_tendenci.css" rel="stylesheet" type="text/css" />
    <link rel="search" type="application/opensearchdescription+xml" title="{{ SITE_GLOBAL_SITEDISPLAYNAME }}" href="{{ SITE_GLOBAL_SITEURL }}{% url open_search %}">
    {% block extra_head %}{% endblock %}
    <link href="{{ STATIC_URL }}css/websymbols.css" rel="stylesheet" type="text/css" />
    {% if request.user.is_authenticated %}
        <link href="{{ STATIC_URL }}css/admin_menu.css" rel="stylesheet" type="text/css" />
        <link href="{{ STATIC_URL }}css/theme_bar.css" rel="stylesheet" type="text/css" />
    {% endif %}
    {% if SITE_GLOBAL_SEMGOOGLEANALYTICSPROFILEID %}
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', '{{ SITE_GLOBAL_SEMGOOGLEANALYTICSPROFILEID }}']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    {% endif %}
</head> 

<body id="{% block body_ids %}{% endblock %}" class="{% block body_classes %}{% endblock %}">
{% block top_bar %}
{% if request.user.is_superuser %}
    {% if request.user.impersonated_user and not request.user.impersonated_user.is_superuser  %}
        {% if request.user.is_authenticated %}
        {% include "top_menu/user_top.html" %}
        {% endif %}
    {% else %}
        {% include "top_menu/admin_top.html" %}
        {% if request.session.theme %}
            {% include "themes/theme_top.html" %}
        {% endif %}
    {% endif %}
{% else %}
    {% if request.user.is_authenticated %}
        {% include "top_menu/user_top.html" %}
    {% endif %}
{% endif %}
{% endblock %}

{% block html_body %}{% endblock %}

{% if request.user.is_superuser %}{# include "admin_menu/admin_bottom.html" #}{% endif %}
</body>

{% block jquery_script %}<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.7.2.min.js"></script>{% endblock jquery_script %}
<script type="text/javascript" src="{{ STATIC_URL }}bootstrap/js/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}bootstrap/js/bootstrap-alerts.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}bootstrap/js/bootstrap-modal.js"></script>
{% if request.user.is_superuser %}<script type="text/javascript" src="{{ STATIC_URL }}js/admin_menu.js"></script>{% endif %}
{% if user.is_authenticated %}<script type="text/javascript" src="{{ STATIC_URL }}js/global/authenticated.js"></script>{% endif %}
{% if request.user.is_authenticated %}
<script type="text/javascript">
$(document).keyup(function(e) {
  if (e.keyCode == 27) { window.location="{% url dashboard %}"; }   // esc
});
</script>
{% endif %}
{% block extra_body %}{% endblock %}
{{ NEW_RELIC_FOOTER|safe }}
</html>
