fixes
This commit is contained in:
parent
ed6ab7cea0
commit
f7d22cf36c
2
main
2
main
|
@ -382,7 +382,7 @@ def signup():
|
||||||
if usersession:
|
if usersession:
|
||||||
return redirect(url_for("main"))
|
return redirect(url_for("main"))
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if not check_username_taken(request.form["username"]) == "error":
|
if not check_username_taken(str(request.form["username"]).lower()) == "error":
|
||||||
flash("Username already taken :3")
|
flash("Username already taken :3")
|
||||||
return redirect(url_for("signup"))
|
return redirect(url_for("signup"))
|
||||||
|
|
||||||
|
|
|
@ -22,15 +22,13 @@ for (let i = 0; i < posts.length; i++) {
|
||||||
title = String(commentBox.value)
|
title = String(commentBox.value)
|
||||||
id = String(commentId.innerHTML)
|
id = String(commentId.innerHTML)
|
||||||
|
|
||||||
|
commentDiv.classList.add("hidden")
|
||||||
|
commentBurgerDiv.classList.remove("hidden")
|
||||||
|
|
||||||
function addPost() {
|
let para = document.createElement("p");
|
||||||
console.log("fart")
|
const node = document.createTextNode(usernameElement.innerHTML + ": " + title);
|
||||||
|
para.appendChild(node)
|
||||||
let para = document.createElement("p");
|
commentBurgerDiv.append(para)
|
||||||
const node = document.createTextNode(usernameElement.innerHTML + ": " + title);
|
|
||||||
para.appendChild(node)
|
|
||||||
commentBurgerDiv.append(para)
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch("/api/comment", {
|
fetch("/api/comment", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
@ -42,8 +40,5 @@ for (let i = 0; i < posts.length; i++) {
|
||||||
"Content-Type": "application/json"
|
"Content-Type": "application/json"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then((response) => addPost())
|
|
||||||
|
|
||||||
commentDiv.classList.add("hidden")
|
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -51,7 +51,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div id="commentBurgerDiv" class="hidden"></div>
|
<div id="commentBurgerDiv" class="hidden commentsdiv"></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p id="commentId" class="hidden">{{ post.id }}</p>
|
<p id="commentId" class="hidden">{{ post.id }}</p>
|
||||||
<button id="commentButton" class="comment">comment</button>
|
<button id="commentButton" class="comment">comment</button>
|
||||||
|
|
Reference in New Issue