{% load i18n static admin_black %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
{% get_direction as direction %}
{% get_admin_black_setting as admin_black_setting %}

<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}">

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="apple-touch-icon" sizes="76x76" href="{% static "admin_black/assets/img/apple-icon.png" %}">
    <link rel="icon" type="image/png" href="{% static "admin_black/assets/img/favicon.png" %}">

    <title>{% block title %}{% endblock %}</title>

    <link href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800" rel="stylesheet"/>
    <link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
{#    <link href="{% static "admin/css/responsive.css" %}" rel="stylesheet"/>#}

    {% if LANGUAGE_BIDI %}
{#        <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css" rel="stylesheet"/>#}
{#        <link href="https://lib.arvancloud.com/ar/bootstrap-rtl/3.4.0/css/bootstrap-rtl.css" rel="stylesheet"/>#}
        <link href="{% static "admin_black/assets/css/bootstrap-rtl.css" %}" rel="stylesheet"/>
{#        <link href="{% static "admin/css/responsive_rtl.css" %}" rel="stylesheet"/>#}
    {% endif %}

    <link href="{% static "admin_black/assets/css/nucleo-icons.css" %}" rel="stylesheet"/>
    <link href="{% static "admin_black/assets/css/black-dashboard.css" %}" rel="stylesheet"/>
    <link href="{% static "admin_black/assets/demo/demo.css" %}" rel="stylesheet"/>
    <link href="{% static "admin_black/assets/css/styles.css" %}" rel="stylesheet"/>

    {% block extrastyle %}{% endblock %}
    {% block extrahead %}{% endblock %}
    {% block blockbots %}
        <meta name="robots" content="NONE,NOARCHIVE">
    {% endblock %}
</head>

<body class="{% if LANGUAGE_BIDI %}rtl menu-on-right{% endif %} {% if not admin_black_setting.dark_mode %}white-content{% endif %}">

<div class="wrapper">
    {% include "admin/sidebar.html" %}

    <div class="main-panel">
        {% if user.is_authenticated %}
            <!-- Navbar -->
            {% include "admin/navigation.html" %}
            <!-- End Navbar -->

            <!-- Breadcrumbs -->
            {% if not is_popup and user.is_authenticated %}
                <div class="breadcrumbs_panel">
                    {% block breadcrumbs %}
                        <div class="breadcrumbs{% if LANGUAGE_BIDI %} rbc{% else %} lbc{% endif %}">
                            <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
                            {% if title %} &rsaquo; {{ title }}{% endif %}
                        </div>
                    {% endblock %}
                </div>
            {% endif %}
            <!-- End Breadcrumbs -->
        {% endif %}

        <!-- Content -->
        {% block content %}{% endblock %}
        <!-- End Content -->

        {% if user.is_authenticated %}
            <!-- Sidebar -->
            {% block sidebar %}{% endblock %}
            <!-- End Sidebar -->
        {% endif %}

        <!-- Footer -->
        {% block footer %}
            {% include "admin/footer.html" %}
        {% endblock %}
        <!-- End Footer -->
    </div>
</div>

{% if user.is_authenticated %}
    {% include "admin/admin_black_setting.html" %}
{% endif %}

<!-- Core JS Files -->
<script src="{% static "admin_black/assets/js/core/jquery.min.js" %}"></script>
<script src="{% static "admin_black/assets/js/core/popper.min.js" %}"></script>
<script src="{% static "admin_black/assets/js/core/bootstrap.min.js" %}"></script>
<script src="{% static "admin_black/assets/js/plugins/perfect-scrollbar.jquery.min.js" %}"></script>
<!-- Google Maps Plugin -->
<!-- Place this tag in your head or just before your close body tag. -->
{#<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>#}
<!-- Chart JS -->
<script src="{% static "admin_black/assets/js/plugins/chartjs.min.js" %}"></script>
<!--  Notifications Plugin    -->
<script src="{% static "admin_black/assets/js/plugins/bootstrap-notify.js" %}"></script>
<!-- Control Center for Black Dashboard: parallax effects, scripts for the example pages etc -->
<script src="{% static "admin_black/assets/js/black-dashboard.min.js" %}"></script>
<!-- Black Dashboard DEMO methods, don't include it in your project! -->
<script src="{% static "admin_black/assets/demo/demo.js" %}"></script>
<script src="https://cdn.trackjs.com/agent/v3/latest/t.js"></script>
<script src="{% static "admin_black/assets/js/scripts.js" %}"></script>

<script>
    {% if messages %}
        {% for message in messages %}
            notification['{{ message.tags }}']("<p class='{{ direction.panel }}'>" + '{{ message|capfirst }}' + "</p>", 'top', '{{ direction.notify }}');
        {% endfor %}
    {% endif %}
</script>

<script type="application/javascript">
    $('select').addClass('form-control');
    $('select').attr('style', 'background-color:{{ admin_black_setting.input_bg_color }};');
    $('input[type="text"]').addClass('form-control');
    $('input[type="number"]').addClass('form-control');
    $('input[type="password"]').addClass('form-control');
    $('input[type="email"]').addClass('form-control');
    $('textarea').addClass('form-control');
    ChangeSidBarBackground('{{ admin_black_setting.sidebar_background }}');
</script>

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