1{{ define "fragments/repoActions" }}
2<div class="flex items-center gap-2 z-auto">
3 <button id="starBtn"
4 class="btn disabled:opacity-50 disabled:cursor-not-allowed"
5
6 {{ if .IsStarred }}
7 hx-delete="/star?subject={{.RepoAt}}&countHint={{.Stats.StarCount}}"
8 {{ else }}
9 hx-post="/star?subject={{.RepoAt}}&countHint={{.Stats.StarCount}}"
10 {{ end }}
11
12 hx-trigger="click"
13 hx-target="#starBtn"
14 hx-swap="outerHTML"
15 hx-disabled-elt="#starBtn"
16 >
17 <div class="flex gap-2 items-center">
18 {{ if .IsStarred }}
19 {{ i "star" "w-4 h-4 fill-current" }}
20 {{ else }}
21 {{ i "star" "w-4 h-4" }}
22 {{ end }}
23 <span>
24 {{ .Stats.StarCount }}
25 </span>
26 </div>
27 </button>
28 {{ if .DisableFork }}
29 <button class="btn no-underline hover:no-underline flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed" disabled title="Empty repositories cannot be forked">
30 {{ i "git-fork" "w-4 h-4"}}
31 fork
32 </button>
33 {{ else }}
34 <a class="btn no-underline hover:no-underline flex items-center gap-2" href="/{{ .FullName }}/fork">
35 {{ i "git-fork" "w-4 h-4"}}
36 fork
37 </a>
38 {{ end }}
39</div>
40{{ end }}
41