aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue/view_content/conversation.tmpl
diff options
context:
space:
mode:
authorSebastian Brückner <code@nik.dev>2024-02-22 07:29:03 +0000
committerGitHub <noreply@github.com>2024-02-22 07:29:03 +0000
commita70c00b80bcb5de8479e407f1b8f08dcf756019d (patch)
tree9868c9b2b1975c3ce5f41dc4894ca0d78530fa0b /templates/repo/issue/view_content/conversation.tmpl
parente9b13732f3d3b5536e43bdfdb5757dbbf484d694 (diff)
downloadgitea-a70c00b80bcb5de8479e407f1b8f08dcf756019d.tar.gz
gitea-a70c00b80bcb5de8479e407f1b8f08dcf756019d.zip
Properly migrate automatic merge GitLab comments (#27873)
GitLab generates "system notes" whenever an event happens within the platform. Unlike Gitea, those events are stored and retrieved as text comments with no semantic details. The only way to tell whether a comment was generated in this manner is the `system` flag on the note type. This PR adds detection for two specific kinds of events: Scheduling and un-scheduling of automatic merges on a PR. When detected, they are downloaded using Gitea's type for these events, and eventually uploaded into Gitea in the expected format, i.e. with no text content in the comment. This PR also updates the template used to render comments to add support for migrated comments of these two types. ref: https://gitlab.com/gitlab-org/gitlab/-/blob/11bd6dc826e0bea2832324a1d7356949a9398884/app/services/system_notes/merge_requests_service.rb#L6-L17 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/repo/issue/view_content/conversation.tmpl')
-rw-r--r--templates/repo/issue/view_content/conversation.tmpl7
1 files changed, 4 insertions, 3 deletions
diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl
index c9e5ee6275..fc1d9865f5 100644
--- a/templates/repo/issue/view_content/conversation.tmpl
+++ b/templates/repo/issue/view_content/conversation.tmpl
@@ -63,12 +63,13 @@
{{end}}
<span class="text grey muted-links">
{{if .OriginalAuthor}}
- <span class="text black gt-font-semibold">
+ <span class="text black">
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
{{.OriginalAuthor}}
</span>
- <span class="text grey muted-links"> {{if $.Repository.OriginalURL}}</span>
- <span class="text migrate">({{ctx.Locale.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}}</span>
+ {{if $.Repository.OriginalURL}}
+ <span class="migrate">({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}})</span>
+ {{end}}
{{else}}
{{template "shared/user/authorlink" .Poster}}
{{end}}