Prak V9; Working on edit
This commit is contained in:
@@ -7,6 +7,11 @@
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||
|
||||
{% load static %}
|
||||
<script src="{% static 'django_eventstream/eventsource.min.js' %}"></script>
|
||||
<script src="{% static 'django_eventstream/reconnecting-eventsource.js' %}"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
{% include 'navbar.html' %}
|
||||
|
||||
@@ -5,6 +5,12 @@ Index
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<script>
|
||||
var es = new ReconnectingEventSource('/events/');
|
||||
es.addEventListener('message', function (e) {console.log(e.data); location.reload();});
|
||||
</script>
|
||||
|
||||
<div class=container>
|
||||
<h1 class="display-4">Your Posts</h1>
|
||||
|
||||
@@ -13,7 +19,10 @@ Index
|
||||
<div class="jumbotron">
|
||||
<h3>{{ notice.notice_title }}</h3>
|
||||
<p>{{ notice.notice_text }}</p>
|
||||
<p><a href="{% url 'delete' deleteId=notice.id %}" class="btn btn-danger" role="button">Delete</a></p>
|
||||
<p>
|
||||
<a href="{% url 'delete' deleteId=notice.id %}" class="btn btn-danger" role="button">Delete</a>
|
||||
<a href="{% url 'edit' editId=notice.id %}" class="btn btn-info" role="button">Edit</a>
|
||||
</p>
|
||||
{% if message %}
|
||||
<script>
|
||||
alert('{{ message }}');
|
||||
|
||||
Reference in New Issue
Block a user