{% extends "base.html" %}
{% block title %}Index.html{% endblock %}
{% block content %}
    <script>
        var es = new ReconnectingEventSource('/events/');
        es.addEventListener('message', function (e) {
            console.log(e.data);
            location.reload();
        }, false);
    </script>

    <form method="post">
    {% for n in notices %}
    <div>
        <p>Titel: {{ n.notice_title }}</p>
        <p>Text: {{ n.notice_text }}</p>
        <p><a href="{% url 'delete' deleteId=n.id %}" class="btn btn-danger" >Löschen</a></p>
    </div>
    {% endfor %}
    <p><a href="{% url 'new' %}" class="btn btn-info" role="button">Neue Nachricht</a></p>
    </form>
{% endblock %}