<html>
    <head>
        <title>{{title}}</title>
        <meta content="ie=edge" http-equiv="x-ua-compatible">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
        <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}" type="text/css">
        {% if form.customstylesheet %}
        <link rel="stylesheet" href="{{ form.customstylesheet }}" type="text/css">
        {% endif %}
        {% if form.favicon %}
        <link rel="icon" href="{{form.favicon}}">
        {% endif %}
    </head>
    <body>
        {% if form.background %}
        <div class="form-background" style="background-image: url('{{form.background}}');">
        {% endif %}
        {% set form_errors = form.errors.get('csrf_token', []) if form else [] %}
        {% with messages = get_flashed_messages() + form_errors %}
        {% if messages %}
        <ul>
            {% for message in messages %}
            <li>{{ message }}</li>
            {% endfor %}
        </ul>
        {% endif %}
        {% endwith %}
        {% block content %}{% endblock %}
        {% if form.background %}
        </div>
        {% endif %}
    </body>
</html>
