forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
at packages 1.8 kB view raw
1{{ define "repo/fragments/repoActions" }} 2 <div class="flex items-center gap-2 z-auto"> 3 <button 4 id="starBtn" 5 class="btn disabled:opacity-50 disabled:cursor-not-allowed flex gap-2 items-center group" 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 {{ if .IsStarred }} 18 {{ i "star" "w-4 h-4 fill-current" }} 19 {{ else }} 20 {{ i "star" "w-4 h-4" }} 21 {{ end }} 22 <span class="text-sm"> 23 {{ .Stats.StarCount }} 24 </span> 25 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 26 </button> 27 {{ if .DisableFork }} 28 <button 29 class="btn text-sm no-underline hover:no-underline flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed" 30 disabled 31 title="Empty repositories cannot be forked" 32 > 33 {{ i "git-fork" "w-4 h-4" }} 34 fork 35 </button> 36 {{ else }} 37 <a 38 class="btn text-sm no-underline hover:no-underline flex items-center gap-2 group" 39 hx-boost="true" 40 href="/{{ .FullName }}/fork" 41 > 42 {{ i "git-fork" "w-4 h-4" }} 43 fork 44 {{ i "loader-circle" "w-4 h-4 animate-spin hidden group-[.htmx-request]:inline" }} 45 </a> 46 {{ end }} 47 </div> 48{{ end }}