:: rewrite ::
This commit is contained in:
parent
e30a136cc2
commit
775cbae281
23 changed files with 724 additions and 326 deletions
26
templates/post.html.tera
Normal file
26
templates/post.html.tera
Normal file
|
@ -0,0 +1,26 @@
|
|||
{% 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 %}
|
Loading…
Add table
Add a link
Reference in a new issue