mirror of https://github.com/bbj-dev/bbj
add new reply button
This commit is contained in:
parent
b88aa96e42
commit
7bad394f14
11
css/base.css
11
css/base.css
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue