1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-06 02:15:20 +02: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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,