DEVELOPMENT ENVIRONMENT

~liljamo/felu

ref: 4992844348f2ecabf096daf60a71f737a928683a felu/internal/components/adminpartials.templ -rw-r--r-- 1.8 KiB
49928443Jonni Liljamo docs: update README.md a day ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package components

import "git.src.quest/~liljamo/felu/internal/db"
import "strconv"

templ AdminPartialUsersList(users []db.User) {
	<table class="table-auto">
		<thead>
			<tr>
				<th class="text-start p-2">
					Id
				</th>
				<th class="text-start p-2">
					Email
				</th>
				<th class="text-start p-2">
					Is Admin
				</th>
			</tr>
		</thead>
		<tbody>
			for _, user := range users {
				<tr class="border">
					<td>
						<div class="p-2">
							<input class="border" value={ user.ID } disabled/>
						</div>
					</td>
					<td>
						<div class="p-2">
							{ user.Email }
						</div>
					</td>
					<td>
						<div class="p-2">
							{ strconv.FormatBool(user.IsAdmin) }
						</div>
					</td>
				</tr>
			}
		</tbody>
	</table>
}

templ AdminPartialDomainsList(domains []db.Domain) {
	<table class="table-auto">
		<thead>
			<tr>
				<th class="text-start p-2">
					Id
				</th>
				<th class="text-start p-2">
					Domain
				</th>
				<th class="text-start p-2">
					A Record
				</th>
				<th class="text-start p-2">
					Owner (ID/Email)
				</th>
			</tr>
		</thead>
		<tbody>
			for _, domain := range domains {
				<tr class="border">
					<td>
						<div class="p-2">
							<input class="border" value={ domain.ID } disabled/>
						</div>
					</td>
					<td>
						<div class="p-2">
							{ domain.Domain }
						</div>
					</td>
					<td>
						<div class="p-2">
							{ domain.A }
						</div>
					</td>
					<td>
						<div class="p-2">
							<div class="flex flex-row-reverse gap-1">
								<input class="peer" type="checkbox"/>
								<input class="border hidden peer-checked:block" value={ domain.Owner.Email } disabled/>
								<input class="border block peer-checked:hidden" value={ domain.Owner.ID } disabled/>
							</div>
						</div>
					</td>
				</tr>
			}
		</tbody>
	</table>
}