From 9f97f38b7cb1ffc4665f04d38752ae3aa3104ab4 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 8 Aug 2018 03:53:33 +0200 Subject: [PATCH] hey it's something --- assets/less/mio/classes/comment.less | 13 +++++++++++-- src/comments.php | 8 +++++--- views/mio/_layout/comments.twig | 7 +++++-- views/mio/errors/master.twig | 7 +++++++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/assets/less/mio/classes/comment.less b/assets/less/mio/classes/comment.less index 7683a7d2..c814e0e3 100644 --- a/assets/less/mio/classes/comment.less +++ b/assets/less/mio/classes/comment.less @@ -4,8 +4,16 @@ margin-bottom: 4px; } - &--hidden { - //display: none; + &__reply-toggle { + display: none; + + &:checked ~ .comment--reply { + display: block; + } + } + + &--reply { + display: none; } &__container { @@ -30,6 +38,7 @@ color: inherit; text-decoration: none; vertical-align: middle; + cursor: pointer; &:not(:last-child) { margin-right: 6px; diff --git a/src/comments.php b/src/comments.php index 261af497..d375ede7 100644 --- a/src/comments.php +++ b/src/comments.php @@ -133,15 +133,17 @@ define('MSZ_COMMENTS_CATEGORY_QUERY', ' ON r.`role_id` = u.`display_role` WHERE p.`category_id` = :category %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( 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( MSZ_COMMENTS_CATEGORY_QUERY, - 'AND p.`comment_reply_to` = :parent' + 'AND p.`comment_reply_to` = :parent', + 'ASC' )); // heavily recursive diff --git a/views/mio/_layout/comments.twig b/views/mio/_layout/comments.twig index c3713af3..d647f5f5 100644 --- a/views/mio/_layout/comments.twig +++ b/views/mio/_layout/comments.twig @@ -1,13 +1,15 @@ {% macro comments_input(category, user, perms, reply_to) %} {% set reply_mode = reply_to is not null %} -
+ {% if reply_mode %} {% endif %} +
@@ -169,7 +171,7 @@ Dislike {% endif %} {% if perms.can_comment %} - Reply + {% endif %} {% if user is not null %} Report @@ -181,6 +183,7 @@
{% 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 %} + {{ comments_input(category, user, perms, comment) }} {% endif %} {% if comment.comment_replies is defined and comment.comment_replies|length > 0 %} diff --git a/views/mio/errors/master.twig b/views/mio/errors/master.twig index 8e438af6..5f7e5e42 100644 --- a/views/mio/errors/master.twig +++ b/views/mio/errors/master.twig @@ -19,5 +19,12 @@
{{ navigation(mio_navigation) }} + + {% if error_code|default(0) >= 500 %} + + {% endif %} {% endblock %}