{% extends "base.html" %}
{% load static %}

{% block title %}{{ title | default:"Swagger" }}{% endblock title %}

{% block extra_styles %}
    <link rel="stylesheet" href="{% static 'drf_spectacular_sidecar/swagger-ui-dist/swagger-ui.css' %}">
    <style>
      /* Manual styling inherited from drf-spectacular */
        html { box-sizing: border-box; overflow-y: scroll; }
        *, *:after, *:before { box-sizing: inherit; }
        body { background: #fafafa; margin: 0; }
      /* Style overrides to address conflicts between Swagger styling and Nautobot/Bootstrap styling */
        pre.version { border: none; background: none; }
        .loading-container .loading { display: block; }
    </style>
{% endblock extra_styles %}

{% block content %}
    <div id="swagger-ui"></div>
{% endblock content %}

{% block javascript %}
    <script src="{% static 'drf_spectacular_sidecar/swagger-ui-dist/swagger-ui-bundle.js' %}"></script>
    <script src="{% static 'drf_spectacular_sidecar/swagger-ui-dist/swagger-ui-standalone-preset.js' %}"></script>
    {% if script_url %}
        <script src="{{ script_url }}"></script>
    {% else %}
        <script>
            {% include './swagger_ui.js' with settings=swagger_settings%}
        </script>
    {% endif %}
{% endblock javascript %}
