From 097d4e30b180eef30600beef2c08095e2571319c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felipe=20Leopoldo=20Sologuren=20Guti=C3=A9rrez?= Date: Fri, 9 Dec 2022 13:25:32 -0300 Subject: [PATCH] Change ID pattern of raw content container for issue (#21966) Implement differentiation to html id for issue raw content container. Fixes #21965 --- templates/repo/diff/comments.tmpl | 2 +- templates/repo/issue/view_content.tmpl | 2 +- templates/repo/issue/view_content/comments.tmpl | 6 +++--- templates/repo/issue/view_content/context_menu.tmpl | 4 ++-- web_src/js/features/repo-issue.js | 2 +- web_src/js/features/repo-legacy.js | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 647c662d5..8fc51e62f 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -54,7 +54,7 @@ {{$.root.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 0cb74e818..9c5f9a477 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -77,7 +77,7 @@ {{.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Issue.Content}}
+
{{.Issue.Content}}
{{if .Issue.Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Issue.Attachments "Content" .Issue.RenderedContent}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index e9b7172d1..d013c7b76 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -77,7 +77,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{if .Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}} @@ -449,7 +449,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{if .Attachments}} {{template "repo/issue/view_content/attachments" Dict "ctx" $ "Attachments" .Attachments "Content" .RenderedContent}} @@ -576,7 +576,7 @@ {{$.locale.Tr "repo.issues.no_content"}} {{end}} -
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl index 45dd08bf6..7459623a5 100644 --- a/templates/repo/issue/view_content/context_menu.tmpl +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -11,9 +11,9 @@ {{$referenceUrl = Printf "%s/files#%s" .ctx.Issue.HTMLURL .item.HashTag}} {{end}}
{{.ctx.locale.Tr "repo.issues.context.copy_link"}}
-
{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}
+
{{.ctx.locale.Tr "repo.issues.context.quote_reply"}}
{{if not .ctx.UnitIssuesGlobalDisabled}} -
{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}
+
{{.ctx.locale.Tr "repo.issues.context.reference_issue"}}
{{end}} {{if or .ctx.Permission.IsAdmin .IsCommentPoster .ctx.HasIssuesOrPullsWritePermission}}
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 54cdeb383..ca5d69c5a 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -553,7 +553,7 @@ export function initRepoIssueReferenceIssue() { const $this = $(this); $this.closest('.dropdown').find('.menu').toggle('visible'); - const content = $(`#comment-${$this.data('target')}`).text(); + const content = $(`#${$this.data('target')}`).text(); const poster = $this.data('poster-username'); const reference = $this.data('reference'); const $modal = $($this.data('modal')); diff --git a/web_src/js/features/repo-legacy.js b/web_src/js/features/repo-legacy.js index d438186c5..910d4bb56 100644 --- a/web_src/js/features/repo-legacy.js +++ b/web_src/js/features/repo-legacy.js @@ -566,7 +566,7 @@ function initRepoIssueCommentEdit() { $(document).on('click', '.quote-reply', function (event) { $(this).closest('.dropdown').find('.menu').toggle('visible'); const target = $(this).data('target'); - const quote = $(`#comment-${target}`).text().replace(/\n/g, '\n> '); + const quote = $(`#${target}`).text().replace(/\n/g, '\n> '); const content = `> ${quote}\n\n`; let easyMDE; if ($(this).hasClass('quote-reply-diff')) {