forked from tangled.org/core
Monorepo for Tangled — https://tangled.org
at issues-edit 3.9 kB view raw
1{{ define "title" }}knots{{ end }} 2{{ define "content" }} 3 <div class="p-6"> 4 <p class="text-xl font-bold dark:text-white">Knots</p> 5 </div> 6 <div class="flex flex-col"> 7 <h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">register a knot</h2> 8 <section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit"> 9 <p class="mb-8 dark:text-gray-300">Generate a key to initialize your knot server.</p> 10 <form 11 hx-put="/knots/key" 12 hx-swap="none" 13 class="max-w-2xl mb-8 space-y-4" 14 > 15 <input 16 type="text" 17 id="domain" 18 name="domain" 19 placeholder="knot.example.com" 20 required 21 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400" 22 /> 23 <button class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600" type="submit"> 24 generate key 25 </button> 26 <div id="settings-knots-error" class="error dark:text-red-400"></div> 27 </form> 28 </section> 29 30 <h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">my knots</h2> 31 <section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit"> 32 <div id="knots-list" class="flex flex-col gap-6 mb-8"> 33 {{ range .Registrations }} 34 {{ if .Registered }} 35 <div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4"> 36 <div class="flex flex-col gap-1"> 37 <div class="inline-flex items-center gap-4"> 38 {{ i "git-branch" "w-3 h-3 dark:text-gray-300" }} 39 <a href="/knots/{{ .Domain }}"> 40 <p class="font-bold dark:text-white">{{ .Domain }}</p> 41 </a> 42 </div> 43 <p class="text-sm text-gray-500 dark:text-gray-400">owned by {{ .ByDid }}</p> 44 <p class="text-sm text-gray-500 dark:text-gray-400">registered {{ .Registered | timeFmt }}</p> 45 </div> 46 </div> 47 {{ end }} 48 {{ else }} 49 <p class="text-sm text-gray-500 dark:text-gray-400">No knots registered</p> 50 {{ end }} 51 </div> 52 </section> 53 54 <h2 class="text-sm font-bold py-2 px-6 uppercase dark:text-gray-300">pending registrations</h2> 55 <section class="rounded bg-white dark:bg-gray-800 drop-shadow-sm px-6 py-4 mb-6 w-full lg:w-fit"> 56 <div id="pending-knots-list" class="flex flex-col gap-6 mb-8"> 57 {{ range .Registrations }} 58 {{ if not .Registered }} 59 <div class="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-4"> 60 <div class="flex flex-col gap-1"> 61 <div class="inline-flex items-center gap-4"> 62 <p class="font-bold dark:text-white">{{ .Domain }}</p> 63 <div class="inline-flex items-center gap-1"> 64 <span class="text-xs bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200 px-2 py-1 rounded"> 65 pending 66 </span> 67 </div> 68 </div> 69 <p class="text-sm text-gray-500 dark:text-gray-400">opened by {{ .ByDid }}</p> 70 <p class="text-sm text-gray-500 dark:text-gray-400">created {{ .Created | timeFmt }}</p> 71 </div> 72 <div class="flex gap-2 items-center"> 73 <button 74 class="btn dark:bg-gray-700 dark:text-white dark:hover:bg-gray-600 gap-2" 75 hx-post="/knots/{{ .Domain }}/init"> 76 {{ i "square-play" "w-5 h-5" }} 77 <span class="hidden md:inline">initialize</span> 78 </button> 79 </div> 80 </div> 81 {{ end }} 82 {{ else }} 83 <p class="text-sm text-gray-500 dark:text-gray-400">No pending registrations</p> 84 {{ end }} 85 </div> 86 </section> 87 </div> 88{{ end }}