demoweb/templates/posts/index.html

41 lines
924 B
HTML
Raw Normal View History

2019-12-03 15:16:55 +01:00
{% extends 'base.html' %}
{% block title %}
Index
{% endblock %}
{% block content %}
<h1>Index der Applikation</h1>
<form action="/posts" method="POST">
{% for notice in notices %}
<div>
<p>published: {{ notice.pub_start }}</p>
<h2><a href="">{{ notice.notice_title }}</a></h2>
<p>{{ notice.notice_text|linebreaksbr }}</p>
<p>
<a href="{% url 'delete' deleteId=notice.id %}" class="btn btn-danger">
Meldung löschen
</a>
</p>
</div>
{% endfor %}
<div>
<p>
<a href="{% url 'new' %}" class="btn btn-info" role="button">Neue Nachricht</a>
</p>
</div>
2019-12-17 14:06:20 +01:00
<script>
var es = new ReconnectingEventSource('/events/');
es.addEventListener('message', function (e) {console.log(e.data);location.reload();}, false);
</script>
2019-12-03 15:16:55 +01:00
</form>
{% endblock %}
2019-12-17 14:06:20 +01:00