
{% extends 'admin/base.html' %}

{% load i18n static cap_tags %}

{% block stylesheet %}
    {% static "cap/css/cap.css" %}
{% endblock %}

{% block extrastyle %}
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,900' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/bootstrap/bootstrap.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/jquery-ui/jquery-ui.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/font-awesome/font-awesome.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/qtip2/jquery.qtip.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/fancybox/jquery.fancybox.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/bootstrap-treeview/bootstrap-treeview.min.css" %}' rel='stylesheet' type='text/css'>
    <link href='{% static "cap/components/bootstrap-tagsinput/bootstrap-tagsinput.css" %}' rel='stylesheet' type='text/css'>
{% endblock %}

{% block extrahead %}
    <link rel="shortcut icon" href="{% static "cap/img/favicon.ico" %}">
{% endblock %}

{% block bodyclass %}{{ block.super|cap_body_class:request }}{% endblock %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}

{% block branding %}
    <h1 id="site-name">
        <a href="{% url 'admin:index' %}">
            {{ site_header|default:_('Django administration') }}
            <span class="header-label">{% trans 'Admin' %}</span></a>
    </h1>
{% endblock %}

{% block pretitle %}
<div class="content-wrap">
    {% block messages %}
        {% if messages %}
            <ul class="messagelist">{% for message in messages %}
                <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
            {% endfor %}</ul>
        {% endif %}
    {% endblock messages %}
{% endblock %}

{% block sidebar %}
    </div> <!-- Close content-wrap -->
{% endblock %}

{% block usertools %}
    {% if has_permission %}
        <div id="user-tools" class="cap-user-tools">
            {% block welcome-msg %}
                <span class="welcome">
                Welcome,
                <strong>{% firstof user.get_short_name user.get_username %}</strong>.
            </span>
            {% endblock %}
            <div class="user-links">
            {% block userlinks %}
                {% if site_url %}
                    <a href="{{ site_url }}" class="icon-link view-site-link" data-title="{% trans 'View site' %}">{% trans 'View site' %}</a>
                    <span class="separator">/</span>

                {% endif %}
                {% if user.is_active and user.is_staff %}
                    {% url 'django-admindocs-docroot' as docsroot %}
                    {% if docsroot %}
                        <a href="{{ docsroot }}" class="icon-link documentation-link" data-title="{% trans 'Documentation' %}">{% trans 'Documentation' %}</a>
                        <span class="separator">/</span>
                    {% endif %}
                {% endif %}
                {% if user.has_usable_password %}
                    <a href="{% url 'admin:password_change' %}" class="icon-link change-password-link" data-title="{% trans 'Change password' %}">{% trans 'Change password' %}</a>
                    <span class="separator">/</span>
                {% endif %}
                <a href="{% url 'admin:logout' %}" class="icon-link logout-link" data-title="{% trans 'Log out' %}">{% trans 'Log out' %}</a>
            {% endblock %}
            </div>
        </div>
    {% endif %}
{% endblock %}

{% block nav-global %}
    {% include 'cap/menu.html' %}
{% endblock %}

{% block footer %}
    {% if not is_popup %}
        <div id="footer">
        <footer class="footer">
            <div class="container-fluid">
                {% block footer_content %}
                    <div class="row">

                        <div class="col-xs-12 col-sm-3 footer-links">
                        </div>

                        <div class="col-xs-12 col-sm-6 text-sm-center footer-copyright">
                        </div>

                        <div class="col-xs-12 col-sm-3 text-sm-right footer-version">

                        </div>

                    </div>
                {% endblock %}
            </div>
        </footer>
    {% endif %}

    {% block js %}
        <script src="{% static "cap/js/cap.js" %}"></script>
        <script src="{% static "cap/components/jquery.min.js" %}"></script>
        <script src="{% static "cap/components/jquery-ui/jquery-ui.min.js" %}"></script>
        <script src="{{ STATIC_URL }}cap/components/jquery-ui/i18n/{{ LANGUAGE_CODE }}.js"></script>
        <script src="{% static "cap/components/jquery.form.min.js" %}"></script>
        <script src="{% static "cap/components/bootstrap/bootstrap.min.js" %}"></script>
        <script src="{% static "cap/components/bootstrap-treeview/bootstrap-treeview.min.js" %}"></script>
        <script src="{% static "cap/components/fancybox/jquery.fancybox.min.js" %}"></script>
        <script src="{% static "cap/components/qtip2/jquery.qtip.min.js" %}"></script>
        <script src="{{ STATIC_URL }}cap/components/bootstrap-tagsinput/bootstrap-tagsinput.js"></script>
        <script src="{{ STATIC_URL }}jquery/ajax-csrf.js"></script>

        <script>
            $(function() {
                $("[data-role=datepicker]").datepicker({
                    dateFormat: 'dd/mm/yy'
                });
            });
        </script>

        {% if cl.formset or action_form and 'toggle_changelist_top_actions'|cap_conf:request %}
            <script type="text/javascript">
                Cap.ListActionsToggle.init();
            </script>
        {% elif adminform %}
            <script type="text/javascript">

                Cap.$("#{{ opts.model_name }}_form").capFormDebounce();

                {% if 'form_submit_on_right'|cap_conf:request %}
                    Cap.FixedBar.init();
                {% endif %}

                {% if adminform.model_admin.cap_form_tabs %}
                    Cap.$(function () {
                        Cap.$('#cap_form_tabs').capFormTabs();
                    });
                {% endif %}
            </script>
        {% endif %}
    {% endblock %}

{% endblock %}
