{% load static i18n %}
<!DOCTYPE html>
<html>
  <head>
    <title>{% trans "PeeringDB API Documentation" %}</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="//unpkg.com/swagger-ui-dist@3/swagger-ui.css" />
    <style>
    .parameters-col_description > input[disabled] {
      display: none;
    }

    div.footer,
    div.header {
      color: #2c8fb2;
      background-color: #fff;
      font-family: Roboto, sans-serif;
      font-weight: 400;
      padding: 5px;
      font-size: 12px;
      text-align: center;
    }

    div.footer a,
    div.header a {
      color: #2c8fb2;
    }

    </style>
  </head>
  <body>
    <div class="header">{% include "apidocs/resources.html" %}</div>
    <div id="swagger-ui"></div>
    <div class="footer">{% include "apidocs/resources.html" %}</div>
    <script src="//unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
    <script>
    const ui = SwaggerUIBundle({
        url: "{% static "api-schema.yaml" %}",
        dom_id: '#swagger-ui',
        presets: [
          SwaggerUIBundle.presets.apis,
          SwaggerUIBundle.SwaggerUIStandalonePreset
        ],
        layout: "BaseLayout",
        requestInterceptor: (request) => {
          request.headers['X-CSRFToken'] = "{{ csrf_token }}"
          return request;
        }
      })
    </script>
  </body>
</html>
