iwakuweb/templates/post.html.tera

27 lines
756 B
Text
Raw Permalink Normal View History

2024-10-05 00:48:55 +02:00
{% 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 %}