27 lines
756 B
Text
27 lines
756 B
Text
|
{% extends "base" %}
|
||
|
{% block title %}post a message{% endblock title %}
|
||
|
{% block content %}
|
||
|
<div id="post-container">
|
||
|
<bu id="name-label">name</bu>
|
||
|
<input type="text" id="name-box" name="name-box"><br>
|
||
|
<div class="break"></div>
|
||
|
<bu id="msg-label">message</bu>
|
||
|
<textarea id="msg-box"></textarea>
|
||
|
<div class="break"></div>
|
||
|
<a class="link" onclick="send_msg()">send!</a>
|
||
|
</div>
|
||
|
<script>
|
||
|
let send_msg = async () => {
|
||
|
fetch("/post_message", {
|
||
|
"method": "POST",
|
||
|
"body": JSON.stringify({
|
||
|
body: document.getElementById("msg-box").value,
|
||
|
name: document.getElementById("name-box").value
|
||
|
}),
|
||
|
}).then(x => {
|
||
|
window.location.reload()
|
||
|
})
|
||
|
}
|
||
|
</script>
|
||
|
{% endblock content %}
|