File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
templates/repo/conversation Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1013,7 +1013,7 @@ func UpdateConversationCommentContent(ctx *context.Context) {
10131013
10141014 // when the update request doesn't intend to update attachments (eg: change checkbox state), ignore attachment updates
10151015 if ! ctx .FormBool ("ignore_attachments" ) {
1016- if err := updateAttachments (ctx , comment , ctx .FormStrings ("files[]" )); err != nil {
1016+ if err := updateConversationAttachments (ctx , comment , ctx .FormStrings ("files[]" )); err != nil {
10171017 ctx .ServerError ("UpdateAttachments" , err )
10181018 return
10191019 }
Original file line number Diff line number Diff line change 7575 {{end}}
7676 </div>
7777 <div id="{{if $IsIssue}}issue{{end}}comment-{{.ID}}-raw" class="raw-content tw-hidden">{{.Content}}</div>
78- <div class="edit-content-zone tw-hidden" data-update-url="{{$.RepoLink}}/comments/{{.ID}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$.RepoLink}}/comments/{{.ID}}/attachments"></div>
78+
79+ {{if $IsIssue}}
80+ {{$EditURL:=printf "%s/%s/%d" $.RepoLink "comments" .ID}}
81+ <div class="edit-content-zone tw-hidden" data-update-url="{{$EditURL}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$EditURL}}/attachments"></div>
82+ {{else}}
83+ {{$EditURL:=printf "%s/%s/%d" $.RepoLink "conversations/comments" .ID}}
84+ <div class="edit-content-zone tw-hidden" data-update-url="{{$EditURL}}" data-content-version="{{.ContentVersion}}" data-context="{{$.RepoLink}}" data-attachment-url="{{$EditURL}}/attachments"></div>
85+ {{end}}
86+
7987 {{if .Attachments}}
8088 {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}}
8189 {{end}}
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export function initRepoConversationCommentEdit() {
7272
7373 const response = await POST ( editContentZone . getAttribute ( 'data-update-url' ) , { data : params } ) ;
7474 const data = await response . json ( ) ;
75+
7576 if ( response . status === 400 ) {
7677 showErrorToast ( data . errorMessage ) ;
7778 return ;
You can’t perform that action at this time.
0 commit comments