{% load i18n %}

<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>Django Datawatch</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
</head>

<body>
    <nav class="navbar navbar-expand-lg bg-light">
        <div class="container-fluid">
            <a class="navbar-brand" href="{% url "django_datawatch_index" %}">Django Datawatch</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
                aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="{% url "django_datawatch_index" %}">{% trans "Home" %}</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container mt-2">
        {% if messages %}
            {% for message in messages %}
                <div class="card mb-4 {% if 'debug' in message.tags or 'info' in message.tags %}text-bg-info{% elif 'success' in message.tags %}text-bg-success{% elif 'error' in message.tags %}text-bg-danger{% elif 'warning' in message.tags %}text-bg-warning{% endif %}">
                    <div class="card-header">
                        <h5 class="card-title pt-2">
                            {% if 'debug' in message.tags %}
                                {% trans 'DEBUG' %}
                            {% elif 'info' in message.tags %}
                                {% trans 'Info' %}
                            {% elif 'success' in message.tags %}
                                {% trans 'Success' %}
                            {% elif 'error' in message.tags %}
                                {% trans 'Error' %}
                            {% else %}
                                {% trans 'Warning' %}
                            {% endif %}
                        </h5>
                    </div>
                    <div class="card-body">
                        {% if 'safe' in message.tags %}
                            {{ message|safe }}
                        {% else %}
                            {{ message }}
                        {% endif %}
                    </div>
                </div>
            {% endfor %}
        {% endif %}

        {% block django_datawatch %}{% endblock %}
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
</body>

</html>