1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Refactor HTTP request context (#17979)

This commit is contained in:
wxiaoguang
2021-12-15 14:59:57 +08:00
committed by GitHub
parent 9d943bf374
commit 4da1d97810
26 changed files with 139 additions and 177 deletions

View File

@@ -2343,7 +2343,7 @@ func ChangeIssueReaction(ctx *context.Context) {
return
}
html, err := ctx.HTMLString(string(tplReactions), map[string]interface{}{
html, err := ctx.RenderToString(tplReactions, map[string]interface{}{
"ctx": ctx.Data,
"ActionURL": fmt.Sprintf("%s/issues/%d/reactions", ctx.Repo.RepoLink, issue.Index),
"Reactions": issue.Reactions.GroupByType(),
@@ -2443,7 +2443,7 @@ func ChangeCommentReaction(ctx *context.Context) {
return
}
html, err := ctx.HTMLString(string(tplReactions), map[string]interface{}{
html, err := ctx.RenderToString(tplReactions, map[string]interface{}{
"ctx": ctx.Data,
"ActionURL": fmt.Sprintf("%s/comments/%d/reactions", ctx.Repo.RepoLink, comment.ID),
"Reactions": comment.Reactions.GroupByType(),
@@ -2565,7 +2565,7 @@ func updateAttachments(item interface{}, files []string) error {
}
func attachmentsHTML(ctx *context.Context, attachments []*repo_model.Attachment, content string) string {
attachHTML, err := ctx.HTMLString(string(tplAttachment), map[string]interface{}{
attachHTML, err := ctx.RenderToString(tplAttachment, map[string]interface{}{
"ctx": ctx.Data,
"Attachments": attachments,
"Content": content,