Skip to content

Commit cad5add

Browse files
committed
fix PR reactions
1 parent 3299075 commit cad5add

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

routers/repo/pull.go

+1
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
422422

423423
ctx.Data["NumCommits"] = compareInfo.Commits.Len()
424424
ctx.Data["NumFiles"] = compareInfo.NumFiles
425+
ctx.Data["AllowedReactions"] = setting.UI.Reactions
425426
return compareInfo
426427
}
427428

templates/repo/diff/comments.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{{$reactions := .Reactions.GroupByType}}
3939
{{if $reactions}}
4040
<div class="ui attached segment reactions">
41-
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions }}
41+
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) "Reactions" $reactions "AllowedReactions" $.AllowedReactions }}
4242
</div>
4343
{{end}}
4444
</div>

templates/repo/issue/view_content/reactions.tmpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@
1010
{{len $value}}
1111
</a>
1212
{{end}}
13-
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.ctx "ActionURL" .ActionURL "AllowedReactions" $.AllowedReactions}}
13+
{{if $.AllowedReactions}}
14+
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $.ctx "ActionURL" .ActionURL "AllowedReactions" $.AllowedReactions}}
15+
{{end}}

0 commit comments

Comments
 (0)