base.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. {# Base template for (almost) all NetBox pages #}
  2. {% load static %}
  3. {% load helpers %}
  4. <!DOCTYPE html>
  5. <html lang="en">
  6. <head>
  7. <meta charset="UTF-8" />
  8. <meta
  9. name="viewport"
  10. content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"
  11. />
  12. {# Page title #}
  13. <title>{% block title %}Home{% endblock %} | NetBox</title>
  14. {# Static resources #}
  15. <link
  16. rel="stylesheet"
  17. href="{% static 'netbox-external.css'%}"
  18. onerror="window.location='{% url 'media_failure' %}?filename=netbox-external.css'"
  19. />
  20. <link
  21. rel="stylesheet"
  22. href="{% static 'netbox-light.css'%}"
  23. onerror="window.location='{% url 'media_failure' %}?filename=netbox-light.css'"
  24. />
  25. <link
  26. rel="stylesheet"
  27. href="{% static 'netbox-dark.css'%}"
  28. onerror="window.location='{% url 'media_failure' %}?filename=netbox-dark.css'"
  29. />
  30. <link rel="icon" type="image/png" href="{% static 'netbox.ico' %}" />
  31. {# Javascript #}
  32. <script
  33. type="text/javascript"
  34. src="{% static 'netbox.js' %}"
  35. onerror="window.location='{% url 'media_failure' %}?filename=netbox.js'">
  36. </script>
  37. {# Additional <head> content #}
  38. {% block head %}{% endblock %}
  39. </head>
  40. <body
  41. {% if preferences|get_key:'ui.colormode' == 'dark'%} data-netbox-color-mode="dark"
  42. {% else %} data-netbox-color-mode="light"
  43. {% endif %}
  44. data-netbox-path="{{ request.path }}"
  45. >
  46. {# Page layout #}
  47. {% block layout %}{% endblock %}
  48. {# Additional Javascript #}
  49. {% block javascript %}{% endblock %}
  50. {# User messages #}
  51. {% include 'inc/messages.html' %}
  52. {# Data container #}
  53. <div id="netbox-data" style="display: none!important; visibility: hidden!important">
  54. {% block data %}{% endblock %}
  55. </div>
  56. </body>
  57. </html>