From 7aafe5e0b4bdd974325c1bc385ddfedae9071d99 Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 8 Nov 2023 05:02:36 +0800 Subject: [PATCH] Fix rendering assignee changed comments without assignee (#27927) (#27952) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport #27927 by @invliD When an assignee changed event comment is rendered, most of it is guarded behind the assignee ID not being 0. However, if it is 0, that results in quite broken rendering for that comment and the next one. This can happen, for example, when repository data imported from outside of Gitea is incomplete. This PR makes sure comments with an assignee ID of 0 are not rendered at all. --- Screenshot before: Bildschirm­foto 2023-11-05 um 20 12 18 The comments in this screenshot are: 1. A regular text comment 2. A user being unassigned 3. A user being assigned 4. The title of the PR being changed Comments 2 and 3 are rendered without any text, which indents the next comment and does not leave enough vertical space. Co-authored-by: Sebastian Brückner --- .../repo/issue/view_content/comments.tmpl | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 714701939fa..5265c09b508 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -4,7 +4,8 @@ {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}