<html>
<head>
    <title><%= $title %></title>
    %= stylesheet "/swagger-ui/swagger-ui.css"
    % if (defined $favicon) {
       <link rel="icon" type="image/png" href=<%= url_for($favicon) %> />
    % }
    <style>
      html
      {
        box-sizing: border-box;
        overflow: -moz-scrollbars-vertical;
        overflow-y: scroll;
      }
      *,
      *:before,
      *:after
      {
        box-sizing: inherit;
      }
      body
      {
        margin:0;
        background: #fafafa;
      }
    </style>
</head>

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

    %= javascript "/swagger-ui/swagger-ui-bundle.js"
    %= javascript "/swagger-ui/swagger-ui-standalone-preset.js"

    <script>
        window.onload = function () {
            const ui = SwaggerUIBundle({
                url: "<%= url_for($url) %>",
                dom_id: '#swagger-ui',
                validatorUrl: <%= $validateUrl %>,
                presets: [
                    SwaggerUIBundle.presets.apis,
                    SwaggerUIStandalonePreset
                ],
                layout: "StandaloneLayout"
            })

            window.ui = ui
        }
    </script>
</body>
</html>
