mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Fix attachments list in edit comment (#13036)
#11141 broke the appearance of dropzone attachments when editting comments causing poorly updating lists. This PR fixes this. Fix #12583 Signed-off-by: Andrew Thornton art27@cantab.net
This commit is contained in:
		| @@ -75,18 +75,25 @@ func AddUploadContext(ctx *context.Context, uploadType string) { | ||||
| 	if uploadType == "release" { | ||||
| 		ctx.Data["UploadUrl"] = ctx.Repo.RepoLink + "/releases/attachments" | ||||
| 		ctx.Data["UploadRemoveUrl"] = ctx.Repo.RepoLink + "/releases/attachments/remove" | ||||
| 		ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/releases/attachments" | ||||
| 		ctx.Data["UploadAccepts"] = strings.Replace(setting.Repository.Release.AllowedTypes, "|", ",", -1) | ||||
| 		ctx.Data["UploadMaxFiles"] = setting.Attachment.MaxFiles | ||||
| 		ctx.Data["UploadMaxSize"] = setting.Attachment.MaxSize | ||||
| 	} else if uploadType == "comment" { | ||||
| 		ctx.Data["UploadUrl"] = ctx.Repo.RepoLink + "/issues/attachments" | ||||
| 		ctx.Data["UploadRemoveUrl"] = ctx.Repo.RepoLink + "/issues/attachments/remove" | ||||
| 		if len(ctx.Params(":index")) > 0 { | ||||
| 			ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/issues/" + ctx.Params(":index") + "/attachments" | ||||
| 		} else { | ||||
| 			ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/issues/attachments" | ||||
| 		} | ||||
| 		ctx.Data["UploadAccepts"] = strings.Replace(setting.Attachment.AllowedTypes, "|", ",", -1) | ||||
| 		ctx.Data["UploadMaxFiles"] = setting.Attachment.MaxFiles | ||||
| 		ctx.Data["UploadMaxSize"] = setting.Attachment.MaxSize | ||||
| 	} else if uploadType == "repo" { | ||||
| 		ctx.Data["UploadUrl"] = ctx.Repo.RepoLink + "/upload-file" | ||||
| 		ctx.Data["UploadRemoveUrl"] = ctx.Repo.RepoLink + "/upload-remove" | ||||
| 		ctx.Data["UploadLinkUrl"] = ctx.Repo.RepoLink + "/upload-file" | ||||
| 		ctx.Data["UploadAccepts"] = strings.Replace(setting.Repository.Upload.AllowedTypes, "|", ",", -1) | ||||
| 		ctx.Data["UploadMaxFiles"] = setting.Repository.Upload.MaxFiles | ||||
| 		ctx.Data["UploadMaxSize"] = setting.Repository.Upload.FileMaxSize | ||||
|   | ||||
		Reference in New Issue
	
	Block a user