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:
parent
9d943bf374
commit
4da1d97810
26 changed files with 139 additions and 177 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue