diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2024-02-25 07:00:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 06:00:55 +0000 |
commit | 2e33671f2c1e98759e4fd2a90944c534cfdf5776 (patch) | |
tree | f8d1343d2ecbdf9b0bd8ed5cd7f1a48eeb33a1af /templates | |
parent | 1ef87773b1e75b99b4b842303542fd17d9c2e6f7 (diff) | |
download | gitea-2e33671f2c1e98759e4fd2a90944c534cfdf5776.tar.gz gitea-2e33671f2c1e98759e4fd2a90944c534cfdf5776.zip |
Add attachment support for code review comments (#29220)
Fixes #27960, #24411, #12183
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates')
-rw-r--r-- | templates/repo/diff/box.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/diff/comment_form.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/diff/comments.tmpl | 5 | ||||
-rw-r--r-- | templates/repo/issue/view_content/conversation.tmpl | 3 |
4 files changed, 18 insertions, 1 deletions
diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index abeeacead0..b9a43a0612 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -237,6 +237,11 @@ "TextareaName" "content" "DropzoneParentContainer" ".ui.form" )}} + {{if .IsAttachmentEnabled}} + <div class="field"> + {{template "repo/upload" .}} + </div> + {{end}} <div class="text right edit buttons"> <button class="ui cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> <button class="ui primary save button">{{ctx.Locale.Tr "repo.issues.save"}}</button> diff --git a/templates/repo/diff/comment_form.tmpl b/templates/repo/diff/comment_form.tmpl index 767c2613a0..54817d4740 100644 --- a/templates/repo/diff/comment_form.tmpl +++ b/templates/repo/diff/comment_form.tmpl @@ -19,6 +19,12 @@ "DisableAutosize" "true" )}} + {{if $.root.IsAttachmentEnabled}} + <div class="field"> + {{template "repo/upload" $.root}} + </div> + {{end}} + <div class="field footer gt-mx-3"> <span class="markup-info">{{svg "octicon-markup"}} {{ctx.Locale.Tr "repo.diff.comment.markdown_info"}}</span> <div class="gt-text-right"> diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index b3d06ed6bc..b795074e49 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -61,7 +61,10 @@ {{end}} </div> <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> - <div class="edit-content-zone gt-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}"></div> + <div class="edit-content-zone gt-hidden" data-update-url="{{$.root.RepoLink}}/comments/{{.ID}}" data-context="{{$.root.RepoLink}}" data-attachment-url="{{$.root.RepoLink}}/comments/{{.ID}}/attachments"></div> + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "Content" .RenderedContent}} + {{end}} </div> {{$reactions := .Reactions.GroupByType}} {{if $reactions}} diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl index 1bc850d8cf..56f1af19b2 100644 --- a/templates/repo/issue/view_content/conversation.tmpl +++ b/templates/repo/issue/view_content/conversation.tmpl @@ -94,6 +94,9 @@ </div> <div id="issuecomment-{{.ID}}-raw" class="raw-content gt-hidden">{{.Content}}</div> <div class="edit-content-zone gt-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div> + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "ctxData" $ "Attachments" .Attachments "Content" .RenderedContent}} + {{end}} </div> {{$reactions := .Reactions.GroupByType}} {{if $reactions}} |