This repository has no description
1{{ define "repo/fragments/reactions" }}
2 <div class="reactions flex flex-wrap items-center gap-2" hx-include="this">
3 {{- $reactions := .Reactions -}}
4 {{- $userReacted := .UserReacted -}}
5 {{- $threadAt := .ThreadAt -}}
6 {{- $parts := splitOn (string $threadAt) "/" -}}
7 {{- $commentRkey := index $parts (sub (len $parts) 1) -}}
8
9 <input name="subject-uri" type="hidden" value="{{ $threadAt }}">
10
11 {{ range $kind := const.OrderedReactionKinds }}
12 {{ $reactionData := index $reactions $kind }}
13 {{ template "repo/fragments/reaction"
14 (dict
15 "Kind" $kind
16 "Count" $reactionData.Count
17 "IsReacted" (index $userReacted $kind)
18 "Users" $reactionData.Users
19 "CommentRkey" $commentRkey
20 "SubjectUri" $threadAt) }}
21 {{ end }}
22
23 {{ if or (not .HideIfEmpty) (gt (len $reactions) 0) }}
24 {{ template "repo/fragments/reactionsPopup" (dict "CommentRkey" $commentRkey "Scope" "body") }}
25 {{ end }}
26
27 </div>
28{{ end }}