base.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {% load i18n static %}<!DOCTYPE html>
  2. {% get_current_language as LANGUAGE_CODE %}{% get_current_language_bidi as LANGUAGE_BIDI %}
  3. <html lang="{{ LANGUAGE_CODE|default:"en-us" }}" dir="{{ LANGUAGE_BIDI|yesno:'rtl,ltr,auto' }}">
  4. <head>
  5. <title>{% block title %}{% endblock %}</title>
  6. <link rel="stylesheet" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}">
  7. {% block dark-mode-vars %}
  8. <link rel="stylesheet" href="{% static "admin/css/dark_mode.css" %}">
  9. <script src="{% static "admin/js/theme.js" %}"></script>
  10. {% endblock %}
  11. {% if not is_popup and is_nav_sidebar_enabled %}
  12. <link rel="stylesheet" href="{% static "admin/css/nav_sidebar.css" %}">
  13. <script src="{% static 'admin/js/nav_sidebar.js' %}" defer></script>
  14. {% endif %}
  15. {% block extrastyle %}{% endblock %}
  16. {% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}">{% endif %}
  17. {% block extrahead %}{% endblock %}
  18. {% block responsive %}
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  20. <link rel="stylesheet" href="{% static "admin/css/responsive.css" %}">
  21. {% if LANGUAGE_BIDI %}<link rel="stylesheet" href="{% static "admin/css/responsive_rtl.css" %}">{% endif %}
  22. {% endblock %}
  23. {% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE">{% endblock %}
  24. </head>
  25. <body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}"
  26. data-admin-utc-offset="{% now "Z" %}">
  27. <a href="#content-start" class="skip-to-content-link">{% translate 'Skip to main content' %}</a>
  28. <!-- Container -->
  29. <div id="container">
  30. {% if not is_popup %}
  31. <!-- Header -->
  32. {% block header %}
  33. <header id="header">
  34. <div id="branding">
  35. {% block branding %}{% endblock %}
  36. </div>
  37. {% block usertools %}
  38. {% if has_permission %}
  39. <div id="user-tools">
  40. {% block welcome-msg %}
  41. {% translate 'Welcome,' %}
  42. <strong>{% firstof user.get_short_name user.get_username %}</strong>.
  43. {% endblock %}
  44. {% block userlinks %}
  45. {% if site_url %}
  46. <a href="{{ site_url }}">{% translate 'View site' %}</a> /
  47. {% endif %}
  48. {% if user.is_active and user.is_staff %}
  49. {% url 'django-admindocs-docroot' as docsroot %}
  50. {% if docsroot %}
  51. <a href="{{ docsroot }}">{% translate 'Documentation' %}</a> /
  52. {% endif %}
  53. {% endif %}
  54. {% if user.has_usable_password %}
  55. <a href="{% url 'admin:password_change' %}">{% translate 'Change password' %}</a> /
  56. {% endif %}
  57. <form id="logout-form" method="post" action="{% url 'admin:logout' %}">
  58. {% csrf_token %}
  59. <button type="submit">{% translate 'Log out' %}</button>
  60. </form>
  61. {% include "admin/color_theme_toggle.html" %}
  62. {% endblock %}
  63. </div>
  64. {% endif %}
  65. {% endblock %}
  66. {% block nav-global %}{% endblock %}
  67. </header>
  68. {% endblock %}
  69. <!-- END Header -->
  70. {% block nav-breadcrumbs %}
  71. <nav aria-label="{% translate 'Breadcrumbs' %}">
  72. {% block breadcrumbs %}
  73. <div class="breadcrumbs">
  74. <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
  75. {% if title %} &rsaquo; {{ title }}{% endif %}
  76. </div>
  77. {% endblock %}
  78. </nav>
  79. {% endblock %}
  80. {% endif %}
  81. <div class="main" id="main">
  82. {% if not is_popup and is_nav_sidebar_enabled %}
  83. {% block nav-sidebar %}
  84. {% include "admin/nav_sidebar.html" %}
  85. {% endblock %}
  86. {% endif %}
  87. <main id="content-start" class="content" tabindex="-1">
  88. {% block messages %}
  89. {% if messages %}
  90. <ul class="messagelist">{% for message in messages %}
  91. <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
  92. {% endfor %}</ul>
  93. {% endif %}
  94. {% endblock messages %}
  95. <!-- Content -->
  96. <div id="content" class="{% block coltype %}colM{% endblock %}">
  97. {% block pretitle %}{% endblock %}
  98. {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
  99. {% block content_subtitle %}{% if subtitle %}<h2>{{ subtitle }}</h2>{% endif %}{% endblock %}
  100. {% block content %}
  101. {% block object-tools %}{% endblock %}
  102. {{ content }}
  103. {% endblock %}
  104. {% block sidebar %}{% endblock %}
  105. <br class="clear">
  106. </div>
  107. <!-- END Content -->
  108. </main>
  109. </div>
  110. <footer id="footer">{% block footer %}{% endblock %}</footer>
  111. </div>
  112. <!-- END Container -->
  113. <!-- SVGs -->
  114. <svg xmlns="http://www.w3.org/2000/svg" class="base-svgs">
  115. <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-auto"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2V4a8 8 0 1 0 0 16z"/></symbol>
  116. <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-moon"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M10 7a7 7 0 0 0 12 4.9v.1c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2h.1A6.979 6.979 0 0 0 10 7zm-6 5a8 8 0 0 0 15.062 3.762A9 9 0 0 1 8.238 4.938 7.999 7.999 0 0 0 4 12z"/></symbol>
  117. <symbol viewBox="0 0 24 24" width="1rem" height="1rem" id="icon-sun"><path d="M0 0h24v24H0z" fill="currentColor"/><path d="M12 18a6 6 0 1 1 0-12 6 6 0 0 1 0 12zm0-2a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM11 1h2v3h-2V1zm0 19h2v3h-2v-3zM3.515 4.929l1.414-1.414L7.05 5.636 5.636 7.05 3.515 4.93zM16.95 18.364l1.414-1.414 2.121 2.121-1.414 1.414-2.121-2.121zm2.121-14.85l1.414 1.415-2.121 2.121-1.414-1.414 2.121-2.121zM5.636 16.95l1.414 1.414-2.121 2.121-1.414-1.414 2.121-2.121zM23 11v2h-3v-2h3zM4 11v2H1v-2h3z"/></symbol>
  118. </svg>
  119. <!-- END SVGs -->
  120. </body>
  121. </html>