{% load i18n static richmin admin_urls %}
{% get_current_language as LANGUAGE_CODE %}
{% get_current_language_bidi as LANGUAGE_BIDI %}
{% get_richmin_settings request as richmin_settings %}
{% get_richmin_ui_tweaks as richmin_ui %}

<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="x-ua-compatible" content="ie=edge">

  <title>{% block title %}{{ title }} | {{ richmin_settings.site_title }}{% endblock %}</title>

  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="{% static "vendor/fontawesome-free/css/all.min.css" %}">

  <!-- Bootstrap and adminLTE -->
  <link rel="stylesheet" href="{% static "vendor/adminlte/css/adminlte.min.css" %}">

  <!-- Bootswatch theme -->
  {% if richmin_ui.theme.name != 'default' %}
    <link rel="stylesheet" href="{{ richmin_ui.theme.src }}" id="richmin-theme"/>
  {% endif %}

  {% if richmin_ui.dark_mode_theme %}
    <link rel="stylesheet" href="{{ richmin_ui.dark_mode_theme.src }}" id="richmin-dark-mode-theme"
          media="(prefers-color-scheme: dark)"/>
  {% endif %}

  <!-- Custom fixes for django -->
  <link rel="stylesheet" href="{% static "richmin/css/main.css" %}">

  {% if LANGUAGE_BIDI %}
    <link rel="stylesheet" href="{% static "richmin/css/rtl.css" %}">
  {% else %}
    <link rel="stylesheet" href="{% static "richmin/css/ltr.css" %}">
  {% endif %}

  {% if richmin_settings.custom_css %}
    <!-- Custom CSS -->
    <link rel="stylesheet" href="{% static richmin_settings.custom_css %}">
  {% endif %}

  <!-- favicons -->
  <link rel="shortcut icon" href="{% static richmin_settings.site_icon %}" type="image/png">
  <link rel="icon" href="{% static richmin_settings.site_icon %}" sizes="32x32" type="image/png">

  {% if richmin_settings.use_google_fonts_cdn %}
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
  {% endif %}

  {% block extrastyle %} {% endblock %}
  {% block extrahead %} {% endblock %}
</head>
<body class="hold-transition richmin-login-page">

<div class="login-box">
  <div class="login-logo">
    <h1>
      <picture>
        <source
          srcset="{% static richmin_settings.login_logo_dark %}"
          media="(prefers-color-scheme: dark)">
        <img src="{% static richmin_settings.login_logo %}" alt="{{ richmin_settings.site_header }}">
      </picture>
    </h1>
  </div>

  <div class="card">
    <div class="card-body">
      {% block content %} {% endblock %}
    </div>
  </div>
</div>

<!-- jQuery -->
<script src="{% static "admin/js/vendor/jquery/jquery.js" %}"></script>
<!-- Bootstrap 4 -->
<script src="{% static 'vendor/bootstrap/js/bootstrap.min.js' %}"></script>
<!-- AdminLTE App -->
<script src="{% static 'vendor/adminlte/js/adminlte.min.js' %}"></script>

{% if richmin_settings.custom_js %}
  <script src="{% static richmin_settings.custom_js %}"></script>
{% endif %}

</body>
</html>
