<!DOCTYPE html>
<html lang="en">
<head>
    <title>{{ apistrap.title }}</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.21.0/swagger-ui.css" />
</head>

<body>
<div id="swagger-ui"></div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.21.0/swagger-ui-bundle.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.21.0/swagger-ui-standalone-preset.js"></script>
<script>
    window.onload = function() {
        window.ui = SwaggerUIBundle({
            url: "{{ apistrap.spec_url }}",
            dom_id: '#swagger-ui',
            presets: [
                SwaggerUIBundle.presets.apis,
                SwaggerUIStandalonePreset
            ]
        });
        {% if apistrap.oauth_client_id %}
        window.ui.initOAuth({
            clientId: "{{ apistrap.oauth_client_id }}",
            clientSecret: "{{ apistrap.oauth_client_secret or "LoremIpsum" }}"
        });
        {% endif %}
    }
</script>
</body>
</html>
