show comment response chkbox

This commit is contained in:
Zdenek Borovec 2024-04-30 02:38:50 +02:00
parent 12e04dcf33
commit 8a67f70166
2 changed files with 45 additions and 49 deletions

View file

@ -267,7 +267,7 @@ code {
margin-left: 0.5em; margin-left: 0.5em;
} }
.comment .comment-own-wrapper{ .comment-own-wrapper{
background-image: url("http://assets.zdenekborovec-dev.cz/common/planks_dark_tile.png"); background-image: url("http://assets.zdenekborovec-dev.cz/common/planks_dark_tile.png");
background-repeat: repeat; background-repeat: repeat;
background-color: black; background-color: black;
@ -275,37 +275,41 @@ code {
border-bottom: 1px solid black; border-bottom: 1px solid black;
} }
.comment .comment-child-wrapper{ .comment-child-wrapper{
border-left: 1px solid black; border-left: 1px solid black;
} }
.comment .comment-metadata, .comment .comment-content {
padding: 0.5em;
}
.comment-metadata {
width: 100%;
}
.comment-metadata tr, .comment-metadata td{
border: none;
padding-bottom: 0px;
}
.comment-metadata .comment-author {
text-align: left;
}
.comment-metadata .comment-date {
text-align: right;
}
.comment-metadata .comment-id {
text-align: right;
color: black;
}
.comment-box { .comment-box {
width: 100%; width: 100%;
height: 5em; height: 5em;
} }
.comment-author {
margin: 0.5em;
display: inline-block;
}
.comment-date {
margin: 0.5em;
display: inline-block;
}
.checkbox-button {
margin: 0.5em;
display: inline-block;
background-image: url("http://assets.zdenekborovec-dev.cz/common/planks_light_tile.png");
background-repeat: repeat;
background-color: white;
color: black;
border: 1px solid black;
cursor: pointer;
}
input[type=checkbox]:checked ~ .comment-response{
display: block;
}
.comment-response {
display: none;
border-top: double black;
}

View file

@ -21,31 +21,24 @@ class BlogpostComment
printf(" printf("
<div class=\"comment\"> <div class=\"comment\">
<div class=\"comment-own-wrapper\"> <div class=\"comment-own-wrapper\">
<table class=\"comment-metadata\"> <span class=\"comment-author\"> By: %s </span>
<tr> <span class=\"comment-date\"> On: %s </span>
<td class=\"comment-author\"> <label for=\"reveal-response-%s\" class=\"checkbox-button\">
By: %s Respond
</td> </label>
<td class=\"comment-date\"> <input type=\"checkbox\" id=\"reveal-response-%s\" style=\"display: none;\">
On: %s
</td>
</tr>
<tr>
<td>
</td>
<td class=\"comment-id\">
%s
</td>
</tr>
</table>
<hr> <hr>
<div class=\"comment-content\"> <div class=\"comment-content\">
%s %s
</div> </div>
<div class=\"comment-response\">
peepeepoopoo
</div>
</div> </div>
<div class=\"comment-child-wrapper\"> <div class=\"comment-child-wrapper\">
", $this->poster_name, date("Y-m-d H:i", ", $this->poster_name, date("Y-m-d H:i",
strtotime($this->timestamp)), $this->comment_id, $this->content); strtotime($this->timestamp)), $this->comment_id, $this->comment_id,
$this->content);
if($this->children != null) { if($this->children != null) {
for($i = 0; $i < count($this->children); $i++) for($i = 0; $i < count($this->children); $i++)
@ -326,11 +319,10 @@ printf("
<h2> Comments: </h2> <h2> Comments: </h2>
<form method=\"post\" action=\"%s\"> <form method=\"post\" action=\"%s\">
<label for=\"comment-entry\">Write comment</label> <label for=\"comment-entry\">Write comment</label>
<input type=\"text\" tabindex=\"1\" value=%s>
<div class=\"centered-container\"> <div class=\"centered-container\">
<textarea id=\"comment-entry\" class=\"comment-box\" tabindex=\"2\"> </textarea> <textarea id=\"comment-entry\" class=\"comment-box\" tabindex=\"1\"> </textarea>
</div> </div>
<input type=\"submit\" tabindex=\"3\" value=\"Send\"> <input type=\"submit\" tabindex=\"2\" value=\"Send\">
</form> </form>
</article> </article>
", htmlspecialchars($_SERVER["PHP_SELF"]), $blogId); ", htmlspecialchars($_SERVER["PHP_SELF"]), $blogId);