add new reply button

This commit is contained in:
r 2024-04-22 16:53:41 -05:00
parent b88aa96e42
commit 7bad394f14
4 changed files with 32 additions and 3 deletions

View File

@ -45,7 +45,7 @@ body {
}
.newThreadButton {
.newPostButton {
font-size: 140%;
padding: 0.5em;
margin: 1em;
@ -56,6 +56,15 @@ body {
display: inline-block;
}
.newReplyButton {
font-size: 120%;
padding: 0.25em;
background-color: black;
color: white;
text-decoration: none;
display: inline-block;
}
pre {
white-space: pre-wrap;
}

View File

@ -40,5 +40,13 @@ function revealThreadCreateForm() {
} else {
form.style.display = "none"
}
}
function revealPostReplyForm() {
form = document.getElementById("postReplyBox")
if (form.style.display == "none") {
form.style.display = "block"
} else {
form.style.display = "none"
}
}

View File

@ -20,7 +20,7 @@
</div>
{% if authorized_user %}
<a class="newThreadButton" href="javascript:revealThreadCreateForm()">Create New Thread</a>
<a class="newPostButton" href="javascript:revealThreadCreateForm()">Create New Thread</a>
<div class="threadCreateBox" id="threadCreateBox" style="display: none;">
<form method="post" action="/threadSubmit">
<label for="title">Title:</label><br>

View File

@ -23,6 +23,18 @@
<h3><span class="color{{ usermap[thread['author']]['color'] }}">{{ usermap[thread["author"]]["user_name"] }}</span>: {{ thread["title"] }}</h3>
{% if authorized_user %}
<a class="newReplyButton" href="javascript:revealPostReplyForm()">Reply</a>
<div class="postReplyBox" id="postReplyBox" style="display: none;">
<form method="post" action="/threadReply">
<label for="postContent">Reply:</label><br>
<textarea type="text" id="postContent" name="postContent" rows="10" cols="50"></textarea><br>
<input type="text" name="threadId" value="{{ thread['thread_id'] }}">
<input type="submit" value="Post">
</form>
</div>
{% endif %}
{% for message in thread["messages"] %}
<div class="message">
<div class="messageHeader">