{% load admin_static %}{% load firstof from future %}{% load i18n grp_tags gipsy_toolbar gipsy_dashboard %}

{% gipsy_is_popup as gipsy_is_popup %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
    <title>{% block title %}{% gipsy_title %}{% endblock %}</title>
    <meta charset="utf-8" />
    {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
    <!-- STYLESHEETS -->
        
        <link href="{% static "grappelli/jquery/ui/css/custom-theme/jquery-ui-1.10.3.custom.min.css" %}" rel="stylesheet" type="text/css" media="screen" />
        <link href="{% static "grappelli/stylesheets/screen.css" %}" rel="stylesheet" type="text/css" media="screen" />
        {% if LANGUAGE_BIDI %}
            <link href="{% static "grappelli/stylesheets/mueller/grid/output-rtl.css" %}" rel="stylesheet" type="text/css" media="screen" />
            <link href="{% block stylesheet_rtl %}{% static "grappelli/stylesheets/rtl.css" %}{% endblock %}" rel="stylesheet" type="text/css" media="screen" />
        {% else %}
            <link href="{% static "grappelli/stylesheets/mueller/grid/output.css" %}" rel="stylesheet" type="text/css" media="screen" />
        {% endif %}
        <link rel="stylesheet" href="{% static "gipsy_toolbar/css/gipsy_toolbar.css" %}">
        <!-- Bootstrap core CSS -->
        <link href="{% static "gipsy_dashboard/css/bootstrap.css" %}" rel="stylesheet">
        <link href="{% static "gipsy_dashboard/css/custom.css" %}" rel="stylesheet">
        <link href="{% gipsy_theme %}" rel="stylesheet">

    {% block stylesheets %}

        <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
        <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->
    {% endblock %}
    <!-- EXTRASTYLES -->
    {% block extrastyle %}{% endblock %}
    <!-- JAVASCRIPTS -->
    {% block javascripts %}
        <script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "grappelli/" %}{% endfilter %}";</script>
        <script type="text/javascript">window.__admin_utc_offset__ = "{% filter escapejs %}{% now "Z" %}{% endfilter %}";</script>
        <script type="text/javascript" charset="utf-8">
            // GLOBALS
            var grappelli = {},
                ADMIN_URL = "{% url 'admin:index' %}",
                MODEL_URL_ARRAY = {% if user.is_staff %}{% get_content_types %}{% else %}[]{% endif %},
                DATE_FORMAT = "{% get_date_format %}",
                TIME_FORMAT = "{% get_time_format %}",
                DATETIME_FORMAT = "{% get_datetime_format %}";
        </script>
        <!-- jQuery, jQuery-UI -->
        <script src="{% static "grappelli/jquery/jquery-1.9.1.min.js" %}" type="text/javascript"></script>
        <script src="{% static "grappelli/jquery/ui/js/jquery-ui-1.10.3.custom.min.js" %}" type="text/javascript"></script>
        {% if debug %}
            <!-- Grappelli Main JS -->
            <script src="{% static "grappelli/js/grappelli.js" %}" type="text/javascript"></script>
            <!-- Grappelli jQuery Plugins, Widgets -->
            <script src="{% static "grappelli/js/jquery.grp_collapsible.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_collapsible_group.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_timepicker.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_related_fk.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_related_m2m.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_related_generic.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_autocomplete_fk.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_autocomplete_m2m.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_autocomplete_generic.js" %}" type="text/javascript"></script>
            <script src="{% static "grappelli/js/jquery.grp_inline.js" %}" type="text/javascript"></script>
        {% else %}
            <!-- Grappelli Minified -->
            <script src="{% static "grappelli/js/grappelli.min.js" %}" type="text/javascript"></script>
        {% endif %}
        <script type="text/javascript" charset="utf-8">
            (function($) {
                $(document).ready(function() {
                    $("#grp-navigation .grp-collapse").grp_collapsible();
                });
            })(grp.jQuery);
        </script>
    {% endblock %}
    <!-- EXTRAHEAD -->
    {% block extrahead %}{% endblock %}
</head>
<body class="{% if is_popup %}grp-popup {% endif %}{% block bodyclass %}{% endblock %}{% if LANGUAGE_BIDI %} rtl{% endif %}">
    <div class="container">
        {% if not gipsy_is_popup %}{% gipsy_toolbar %}{% endif %}
        
        {% block header %}
            <!-- HEADER -->
            <header id="grp-header" class="{% block header-class %}{% endblock %}">
                {% if not is_popup %}

                    {% block context-navigation %}
                        <!-- CONTEXT NAVIGATION -->
                        <div id="grp-context-navigation">
                            <nav id="grp-breadcrumbs" class="{% block breadcrumbs-class %}{% endblock %}">
                                <header style="display:none"><h1>Breadcrumbs</h1></header>
                                {% block breadcrumbs %}
                                    <ul>
                                        <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a></li>
                                        {% if title %}
                                            <li> &rsaquo; {{ title }}</li>
                                        {% endif %}
                                    </ul>
                                {% endblock %}
                            </nav>
                        </div>
                    {% endblock %}
                    
                {% endif %}
            </header>
        {% endblock %}        
        
        <div id="grp-container" class="">
            <div class="row">
                {% if not gipsy_is_popup %}{% gipsy_dashboard_menu %}{% endif %}
                <div{% if not gipsy_is_popup %} class="col-md-10"{% endif %}>
                    <!-- CONTENT -->
                    <article id="grp-content" class="{% block content-class %}{% endblock %}">
                        
                        <!-- MESSAGES -->
                        {% block messages %}
                            {% if messages %}
                                <ul class="grp-messagelist">
                                    <!-- NOTE: no message|capfirst by purpose, because it does not work in some languages -->
                                    {% for message in messages %} 
                                        <li{% if message.tags %} class="grp-{{ message.tags }}"{% endif %}>{{ message }}</li>
                                    {% endfor %}
                                </ul>
                            {% endif %}
                        {% endblock %}

                        <!-- CONTENT TITLE -->
                        <header id="grp-content-title">
                            {% block pretitle %}{% endblock %}
                            {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
                            {% block object-tools %}{% endblock %}
                        </header>

                        <!-- CONTENT-CONTAINER -->
                        <div id="grp-content-container">
                            {% block content %}
                                {{ content }}
                                {% block filters %}{% endblock %}
                            {% endblock %}
                        </div>

                    </article>
                </div>
            </div>
        </div>
        {% block footer %}{% endblock %}
    </div>
    <script src="{{ STATIC_URL }}gipsy_dashboard/js/vendor/jquery.js"></script>
    <script src="{{ STATIC_URL }}gipsy_dashboard/javascripts/bootstrap.js"></script>
    <script src="{{ STATIC_URL }}gipsy_dashboard/javascripts/plugins.js"></script>
    <script src="{{ STATIC_URL }}gipsy_dashboard/javascripts/main.js"></script>
    <script>var gipsy = {jQuery: jQuery.noConflict(true)};</script>
</body>
</html>
