From 22dea71063f52fed2ea07fc7d3b1c6eb3ee0f3e5 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 16 Dec 2018 20:40:50 +0100 Subject: [PATCH] Better handling of deleted comments with replies. --- templates/_layout/comments.twig | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/templates/_layout/comments.twig b/templates/_layout/comments.twig index 6e035f9f..655846fa 100644 --- a/templates/_layout/comments.twig +++ b/templates/_layout/comments.twig @@ -41,19 +41,27 @@ {% macro comments_entry(comment, indent, category, user, perms) %} {% from '_layout/input.twig' import input_checkbox_raw %} + {% set is_deleted = comment.comment_deleted is not null %} + {% set hide_details = is_deleted and not perms.can_delete_any %} - {% if perms.can_delete_any or (comment.comment_deleted is null or comment.comment_replies|length > 0) %} -
+ {% if perms.can_delete_any or (not is_deleted or comment.comment_replies|length > 0) %} +