forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
1{{ define "user/fragments/editPins" }} 2 {{ $profile := .Profile }} 3 <form 4 hx-post="/profile/pins" 5 hx-disabled-elt="#save-btn,#cancel-btn" 6 hx-swap="none" 7 hx-indicator="#spinner"> 8 <div class="flex items-center justify-between mb-2"> 9 <p class="text-sm font-bold p-2 dark:text-white">SELECT PINNED REPOS</p> 10 <div class="flex items-center gap-2"> 11 <button id="save-btn" type="submit" class="btn px-2 flex items-center gap-2 no-underline text-sm"> 12 {{ i "check" "w-3 h-3" }} save 13 <span id="spinner" class="group"> 14 {{ i "loader-circle" "w-3 h-3 animate-spin hidden group-[.htmx-request]:inline" }} 15 </span> 16 </button> 17 <a href="/{{.LoggedInUser.Did}}" class="w-full no-underline hover:no-underline"> 18 <button id="cancel-btn" type="button" class="btn px-2 w-full flex items-center gap-2 no-underline text-sm"> 19 {{ i "x" "w-3 h-3" }} cancel 20 </button> 21 </a> 22 </div> 23 </div> 24 <div id="repos" class="grid grid-cols-1 gap-1 mb-6 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700"> 25 {{ range $idx, $r := .AllRepos }} 26 <div class="flex items-center gap-2 text-base p-2 border-b border-gray-200 dark:border-gray-700"> 27 <input type="checkbox" id="repo-{{$idx}}" name="pinnedRepo{{$idx}}" value="{{.RepoAt}}" {{if .IsPinned}}checked{{end}}> 28 <label for="repo-{{$idx}}" class="my-0 py-0 normal-case font-normal w-full"> 29 <div class="flex justify-between items-center w-full"> 30 <span class="flex-shrink-0 overflow-hidden text-ellipsis ">{{ index $.DidHandleMap .Did }}/{{.Name}}</span> 31 <div class="flex gap-1 items-center"> 32 {{ i "star" "size-4 fill-current" }} 33 <span>{{ .RepoStats.StarCount }}</span> 34 </div> 35 </div> 36 </label> 37 </div> 38 {{ end }} 39 </div> 40 41 </form> 42{{ end }}