From e80f446d3a0e7f0989dedeb88b09473ad15657a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Br=C3=BCckner?= Date: Tue, 7 Nov 2023 18:45:06 +0000 Subject: [PATCH] Fix rendering assignee changed comments without assignee (#27927) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: Giteabot --- .../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 baa3380c65..817f20af20 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}}