fix controls

This commit is contained in:
Daniella / Tove 2022-01-19 09:08:36 +01:00
parent 8ba78a8e69
commit 05564258ec

View file

@ -32,7 +32,7 @@
border: 1px solid #808080;
}
post .content a.controls {
post .content .controls {
display: block;
text-align: right;
}
@ -114,10 +114,11 @@
.replaceAll('["\n', '<pre>').replaceAll('\n"]', '</pre>')
.replaceAll('["" \n', '<pre>').replaceAll('\n ""]', '</pre>')
.replaceAll('\n', '<br/>')
ret += '<div class="controls">'
if (postid != -1 || id == '') {
if(makeForm) {
if(postid != -1)
ret += `<a class="controls" href="/post/${postid}">[Nevermind]</a>`
ret += `<a href="/post/${postid}">[Nevermind]</a>`
ret +=
`</div><post><div class="content"><form><label>` +
`<h3><input type="username" name="name" value="Anonymous" required>: <input type="text" name="title" placeholder="Title" required></h3>` +
@ -125,10 +126,11 @@
`</label></form></div></post>`
}
else
ret += `<a class="controls" href="/comment/${postid}/${id}">[Reply]</a> </div>`
ret += `<a href="/comment/${postid}/${id}">[Reply]</a> </div>`
}
else
ret += `<a class="controls" href="/post/${id}">[Open]</a></div>`
ret += `<a href="/post/${id}">[Open]</a></div>`
ret += '</div>'
for(let i = post.comments.length - 1; i >= 0; i--) {
const pid = id
id += i + '_'