hey it's something
This commit is contained in:
parent
74f5fd0921
commit
9f97f38b7c
4 changed files with 28 additions and 7 deletions
|
@ -4,8 +4,16 @@
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&--hidden {
|
&__reply-toggle {
|
||||||
//display: none;
|
display: none;
|
||||||
|
|
||||||
|
&:checked ~ .comment--reply {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--reply {
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&__container {
|
&__container {
|
||||||
|
@ -30,6 +38,7 @@
|
||||||
color: inherit;
|
color: inherit;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
margin-right: 6px;
|
margin-right: 6px;
|
||||||
|
|
|
@ -133,15 +133,17 @@ define('MSZ_COMMENTS_CATEGORY_QUERY', '
|
||||||
ON r.`role_id` = u.`display_role`
|
ON r.`role_id` = u.`display_role`
|
||||||
WHERE p.`category_id` = :category
|
WHERE p.`category_id` = :category
|
||||||
%s
|
%s
|
||||||
ORDER BY p.`comment_pinned` DESC, p.`comment_id` DESC
|
ORDER BY p.`comment_pinned` DESC, p.`comment_id` %s
|
||||||
');
|
');
|
||||||
define('MSZ_COMMENTS_CATEGORY_QUERY_ROOT', sprintf(
|
define('MSZ_COMMENTS_CATEGORY_QUERY_ROOT', sprintf(
|
||||||
MSZ_COMMENTS_CATEGORY_QUERY,
|
MSZ_COMMENTS_CATEGORY_QUERY,
|
||||||
'AND p.`comment_reply_to` IS NULL'
|
'AND p.`comment_reply_to` IS NULL',
|
||||||
|
'DESC'
|
||||||
));
|
));
|
||||||
define('MSZ_COMMENTS_CATEGORY_QUERY_REPLIES', sprintf(
|
define('MSZ_COMMENTS_CATEGORY_QUERY_REPLIES', sprintf(
|
||||||
MSZ_COMMENTS_CATEGORY_QUERY,
|
MSZ_COMMENTS_CATEGORY_QUERY,
|
||||||
'AND p.`comment_reply_to` = :parent'
|
'AND p.`comment_reply_to` = :parent',
|
||||||
|
'ASC'
|
||||||
));
|
));
|
||||||
|
|
||||||
// heavily recursive
|
// heavily recursive
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
{% macro comments_input(category, user, perms, reply_to) %}
|
{% macro comments_input(category, user, perms, reply_to) %}
|
||||||
{% set reply_mode = reply_to is not null %}
|
{% set reply_mode = reply_to is not null %}
|
||||||
|
|
||||||
<form class="comment comment--input{% if reply_mode %} comment--hidden{% endif %}"
|
<form class="comment comment--input{% if reply_mode %} comment--reply{% endif %}"
|
||||||
method="post" action="/comments.php"
|
method="post" action="/comments.php"
|
||||||
id="comment-{{ reply_mode ? 'reply-' ~ reply_to.comment_id : 'create-' ~ category.category_id }}">
|
id="comment-{{ reply_mode ? 'reply-' ~ reply_to.comment_id : 'create-' ~ category.category_id }}">
|
||||||
<input type="hidden" name="comment[category]" value="{{ category.category_id }}">
|
<input type="hidden" name="comment[category]" value="{{ category.category_id }}">
|
||||||
|
|
||||||
{% if reply_mode %}
|
{% if reply_mode %}
|
||||||
<input type="hidden" name="comment[reply]" value="{{ reply_to.comment_id }}">
|
<input type="hidden" name="comment[reply]" value="{{ reply_to.comment_id }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="comment__container">
|
<div class="comment__container">
|
||||||
<div class="avatar comment__avatar"
|
<div class="avatar comment__avatar"
|
||||||
style="background-image:url('/profile.php?m=avatar&u={{ user.user_id }}')">
|
style="background-image:url('/profile.php?m=avatar&u={{ user.user_id }}')">
|
||||||
|
@ -169,7 +171,7 @@
|
||||||
<a class="comment__action comment__action--link" href="javascript:void(0)" onclick="commentVote(this, {{ comment.comment_id }}, -1)">Dislike</a>
|
<a class="comment__action comment__action--link" href="javascript:void(0)" onclick="commentVote(this, {{ comment.comment_id }}, -1)">Dislike</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if perms.can_comment %}
|
{% if perms.can_comment %}
|
||||||
<a class="comment__action comment__action--link" href="#">Reply</a>
|
<label class="comment__action comment__action--link" for="comment-reply-toggle-{{ comment.comment_id }}">Reply</label>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if user is not null %}
|
{% if user is not null %}
|
||||||
<a class="comment__action comment__action--link comment__action--hide" href="#">Report</a>
|
<a class="comment__action comment__action--link comment__action--hide" href="#">Report</a>
|
||||||
|
@ -181,6 +183,7 @@
|
||||||
<div class="comment__replies comment__replies--indent-{{ indent }}" id="comment-{{ comment.comment_id }}-replies">
|
<div class="comment__replies comment__replies--indent-{{ indent }}" id="comment-{{ comment.comment_id }}-replies">
|
||||||
{% from _self import comments_entry, comments_input %}
|
{% from _self import comments_entry, comments_input %}
|
||||||
{% if user|default(null) is not null and category|default(null) is not null and perms|default(null) is not null and perms.can_comment %}
|
{% if user|default(null) is not null and category|default(null) is not null and perms|default(null) is not null and perms.can_comment %}
|
||||||
|
<input type="checkbox" class="comment__reply-toggle" id="comment-reply-toggle-{{ comment.comment_id }}">
|
||||||
{{ comments_input(category, user, perms, comment) }}
|
{{ comments_input(category, user, perms, comment) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if comment.comment_replies is defined and comment.comment_replies|length > 0 %}
|
{% if comment.comment_replies is defined and comment.comment_replies|length > 0 %}
|
||||||
|
|
|
@ -19,5 +19,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ navigation(mio_navigation) }}
|
{{ navigation(mio_navigation) }}
|
||||||
|
|
||||||
|
{% if error_code|default(0) >= 500 %}
|
||||||
|
<audio autoplay>
|
||||||
|
<source src="https://static.flash.moe/sounds/wbrb.ogg" type="audio/ogg">
|
||||||
|
<source src="https://static.flash.moe/sounds/wbrb.mp3" type="audio/mp3">
|
||||||
|
</audio>
|
||||||
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue