mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-25 15:13:48 +08:00
4b1063f3db
Enable `no-sizzle` lint rule, there was only one use in `initCompReactionSelector` and: - Remove all jQuery except the necessary fomantic dropdown init - Remove the recursion, instead bind event listeners to common parent container nodes --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
18 lines
978 B
Handlebars
18 lines
978 B
Handlebars
<div class="bottom-reactions" data-action-url="{{$.ActionURL}}">
|
|
{{range $key, $value := .Reactions}}
|
|
{{$hasReacted := $value.HasUser ctx.RootData.SignedUserID}}
|
|
<a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not ctx.RootData.IsSigned}} disabled{{end}} comment-reaction-button"
|
|
data-tooltip-content
|
|
title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
|
|
aria-label="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
|
|
data-tooltip-placement="bottom-start"
|
|
data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
|
|
<span class="reaction">{{ReactionToEmoji $key}}</span>
|
|
<span class="reaction-count">{{len $value}}</span>
|
|
</a>
|
|
{{end}}
|
|
{{if AllowedReactions}}
|
|
{{template "repo/issue/view_content/add_reaction" dict "ActionURL" .ActionURL}}
|
|
{{end}}
|
|
</div>
|