base.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {# Base template for (almost) all NetBox pages #}
  2. {% load static %}
  3. {% load helpers %}
  4. {% load i18n %}
  5. {% load django_htmx %}
  6. <!DOCTYPE html>
  7. <html
  8. lang="en"
  9. data-netbox-url-name="{{ request.resolver_match.url_name }}"
  10. data-netbox-base-path="{{ settings.BASE_PATH }}"
  11. >
  12. <head>
  13. <meta charset="UTF-8" />
  14. <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width, viewport-fit=cover" />
  15. <meta name="htmx-config" content='{"scrollBehavior": "auto"}'>
  16. {# Page title #}
  17. <title>{% block title %}{% trans "Home" %}{% endblock %} | NetBox</title>
  18. {# Initialize color mode #}
  19. <script
  20. type="text/javascript"
  21. src="{% static 'setmode.js' %}?v={{ settings.VERSION }}"
  22. onerror="window.location='{% url 'media_failure' %}?filename=setmode.js'">
  23. </script>
  24. <script type="text/javascript">
  25. (function () {
  26. initMode()
  27. })();
  28. window.CSRF_TOKEN = "{{ csrf_token }}";
  29. </script>
  30. {# Static resources #}
  31. <link
  32. rel="stylesheet"
  33. href="{% static 'netbox-external.css'%}?v={{ settings.VERSION }}"
  34. onerror="window.location='{% url 'media_failure' %}?filename=netbox-external.css'"
  35. />
  36. <link
  37. rel="stylesheet"
  38. href="{% static 'netbox.css'%}?v={{ settings.VERSION }}"
  39. onerror="window.location='{% url 'media_failure' %}?filename=netbox.css'"
  40. />
  41. <link rel="icon" type="image/png" href="{% static 'netbox.ico' %}" />
  42. <link rel="apple-touch-icon" type="image/png" href="{% static 'netbox_touch-icon-180.png' %}" />
  43. {# Javascript #}
  44. <script
  45. type="text/javascript"
  46. src="{% static 'netbox.js' %}?v={{ settings.VERSION }}"
  47. onerror="window.location='{% url 'media_failure' %}?filename=netbox.js'">
  48. </script>
  49. {% django_htmx_script %}
  50. {# Additional <head> content #}
  51. {% block head %}{% endblock %}
  52. </head>
  53. <body>
  54. {# Page layout #}
  55. {% block layout %}{% endblock %}
  56. {# Additional Javascript #}
  57. {% block javascript %}{% endblock %}
  58. {# User messages #}
  59. {% include 'inc/messages.html' %}
  60. </body>
  61. </html>