this repo has no description
1{{ define "title" }}knots{{ end }}
2
3{{ define "content" }}
4 <h1>knots</h1>
5
6 <section class="mb-12">
7 <h2 class="text-2xl mb-4">register a knot</h2>
8 <form hx-post="/knots/key" class="flex gap-4 items-end">
9 <div>
10 <label for="domain"
11 >Generate a key to start your knot with.</label
12 >
13 <input
14 type="text"
15 id="domain"
16 name="domain"
17 placeholder="knot.example.com"
18 required
19 />
20 </div>
21 <button class="btn" type="submit">generate key</button>
22 </form>
23 </section>
24
25 <section class="mb-12">
26 <h3 class="text-xl font-semibold mb-4">my knots</h3>
27 <ul id="my-knots" class="space-y-6">
28 {{ range .Registrations }}
29 {{ if .Registered }}
30 <li class="border rounded p-4 flex flex-col gap-2">
31 <div>
32 <a href="/knots/{{ .Domain }}" class="font-semibold"
33 >{{ .Domain }}</a
34 >
35 </div>
36 <div class="text-gray-600">
37 Owned by
38 {{ .ByDid }}
39 </div>
40 <div class="text-gray-600">
41 Registered on
42 {{ .Registered }}
43 </div>
44 </li>
45 {{ end }}
46 {{ else }}
47 <p class="text-gray-600">you don't have any knots yet</p>
48 {{ end }}
49 </ul>
50 </section>
51
52 <section>
53 <h3 class="text-xl font-semibold mb-4">pending registrations</h3>
54 <ul id="pending-registrations" class="space-y-6">
55 {{ range .Registrations }}
56 {{ if not .Registered }}
57 <li class="border rounded p-4 flex flex-col gap-2">
58 <div>
59 <a
60 href="/knots/{{ .Domain }}"
61 class="text-blue-600 hover:underline"
62 >{{ .Domain }}</a
63 >
64 </div>
65 <div class="text-gray-600">
66 Opened by
67 {{ .ByDid }}
68 </div>
69 <div class="text-gray-600">
70 Created on
71 {{ .Created }}
72 </div>
73 <div class="flex items-center gap-4 mt-2">
74 <span class="text-amber-600"
75 >pending registration</span
76 >
77 <button
78 class="btn"
79 hx-post="/knots/{{ .Domain }}/init"
80 >
81 initialize
82 </button>
83 </div>
84 </li>
85 {{ end }}
86 {{ else }}
87 <p class="text-gray-600">no registrations yet</p>
88 {{ end }}
89 </ul>
90 </section>
91{{ end }}