{% extends '__layout__.html' %}
{% block title %}Admin{% endblock %}
{% block head %}
<link href="/static/css/admin.css" rel="stylesheet"/> <!-- Its just easier to resuse this-->
{% endblock %}
{% block content %}
<div id="main">
    <div class="container">
        <a href="/admin" class="btn border-primary btn-sm mb-2">Back to Admin Panel</a>
        {% with messages = get_flashed_messages(with_categories=true) %}
        {% if messages %}
        <div>
        {% for category, message in messages %}
            {% if category == 'error' %}
            <div class="alert border p-2 text-center alert-danger border-danger mb-2">
                {{ message }}
            </div>
            {% endif %}
            {% if category == 'danger' %}
            <div class="alert border p-2 text-center alert-danger border-danger mb-2">
                {{ message }}
            </div>
            {% endif %}
            {% if category == 'success' %}
            <div class="alert border p-2 text-center alert-success border-success mb-2">
                {{ message }}
            </div>
            {% endif %}
        {% endfor %}
        </div>
        {% endif %}
        {% endwith %}
        <h1>Website wide message</h1>
        <p class="m-0">plz do not put anything useless on here thxxx</p>
        <div class="linebreak"></div>
        <form method="post">
            <input type="text" name="message" class="form-control" value="{{message}}" placeholder="Message">
            <input type="hidden" name="csrf_token" value="{{csrf_token()}}">
            <input type="submit" class="btn btn-primary mt-2" value="Save">
        </form>
    </div>
</div>
{% endblock %}