Praktikum8

This commit is contained in:
2019-12-10 15:33:46 +01:00
parent d3fc3d5e39
commit c97f4b9c7f
5 changed files with 23 additions and 2 deletions
+11 -1
View File
@@ -3,6 +3,7 @@
<div class="container">
{% for notice in notices %}
<h3> {{ notice.notice_title }}</h3>
@@ -13,4 +14,13 @@
<p><a href="{% url 'new' %}" class="btn btn-info" role="button">Neue Nachricht</a></p>
<p><a href="{% url 'logout' %}" class="btn btn-warning">Abmelden</a></p>
{% endblock %}
</div>
<script>
var es = new ReconnectingEventSource('/events/');
es.addEventListener('message',function(e) {
console.log(e.data); location.reload();false
})
</script>
{% endblock %}