tangled
alpha
login
or
join now
moth11.net
/
xcvr
2
fork
atom
frontend for xcvr appview
2
fork
atom
overview
issues
pulls
pipelines
make prettier a lil smidge
moth11.net
4 months ago
7437caf8
d6821a5c
+66
-35
2 changed files
expand all
collapse all
unified
split
src
routes
b
+page.svelte
[id]
+page.svelte
+25
src/routes/b/+page.svelte
···
1
1
+
<script lang="ts">
2
2
+
const base = import.meta.env.VITE_API_URL;
3
3
+
</script>
4
4
+
5
5
+
<main>
6
6
+
<h1>try to ban someone</h1>
7
7
+
<p>this probably shouldn't do anything unless you're me</p>
8
8
+
<form action={`${base}/oauth/ban`} method="POST">
9
9
+
<div>
10
10
+
<label for="user">user to ban: </label>
11
11
+
<input type="text" name="user" id="user" required />
12
12
+
</div>
13
13
+
<div>
14
14
+
<label for="days">number of days to ban for: </label>
15
15
+
<input type="text" name="days" id="days" />
16
16
+
</div>
17
17
+
<div>
18
18
+
<label for="reason">reason: </label>
19
19
+
<input type="text" name="reason" id="reason" />
20
20
+
</div>
21
21
+
<div>
22
22
+
<input type="submit" value="ban" />
23
23
+
</div>
24
24
+
</form>
25
25
+
</main>
+41
-35
src/routes/b/[id]/+page.svelte
···
8
8
const base = import.meta.env.VITE_API_URL;
9
9
</script>
10
10
11
11
-
{#if data.ban}
12
12
-
{#await fetchhandle(data.ban.did)}
13
13
-
fetching handle
14
14
-
{:then result}
15
15
-
{result.alsoKnownAs[0]}
16
16
-
{:catch}
17
17
-
error fetching handle
18
18
-
{/await}
19
19
-
({data.ban.did}) was banned {smartAbsoluteTimestamp(data.ban.bannedAt)}
20
20
-
{#if data.ban.reason}
21
21
-
for {data.ban.reason}.
22
22
-
{/if}
23
23
-
{#if data.ban.till}
24
24
-
the ban will end on {dumbAbsoluteTimestamp(data.ban.till)}.
11
11
+
<main>
12
12
+
{#if data.ban}
13
13
+
{#await fetchhandle(data.ban.did)}
14
14
+
fetching handle
15
15
+
{:then result}
16
16
+
<h1>{result.alsoKnownAs[0]}</h1>
17
17
+
{:catch}
18
18
+
error fetching handle
19
19
+
{/await}
20
20
+
({data.ban.did}) was banned {smartAbsoluteTimestamp(
21
21
+
Date.parse(data.ban.bannedAt),
22
22
+
)}
23
23
+
{#if data.ban.reason}
24
24
+
for {data.ban.reason}.
25
25
+
{/if}
26
26
+
{#if data.ban.till}
27
27
+
the ban will end on {dumbAbsoluteTimestamp(data.ban.till)}.
28
28
+
{/if}
29
29
+
{:else}
30
30
+
i can't find ban
25
31
{/if}
26
26
-
{:else}
27
27
-
i can't find ban
28
28
-
{/if}
32
32
+
</main>
29
33
30
34
{#if data.myProfile.loggedIn}
31
31
-
try to ban user
32
32
-
<form action={`${base}/oauth/ban`} method="POST">
33
33
-
<div>
34
34
-
<label for="user">user to ban: </label>
35
35
-
<input type="text" name="user" id="user" required />
36
36
-
</div>
37
37
-
<div>
38
38
-
<label for="days">number of days to ban for: </label>
39
39
-
<input type="text" name="days" id="days" />
40
40
-
</div>
41
41
-
<div>
42
42
-
<label for="reason">reason: </label>
43
43
-
<input type="text" name="reason" id="reason" />
44
44
-
</div>
45
45
-
<div>
46
46
-
<input type="submit" value="ban" />
47
47
-
</div>
48
48
-
</form>
35
35
+
<aside>
36
36
+
<h3>try to ban user</h3>
37
37
+
<form action={`${base}/oauth/ban`} method="POST">
38
38
+
<div>
39
39
+
<label for="user">user to ban: </label>
40
40
+
<input type="text" name="user" id="user" required />
41
41
+
</div>
42
42
+
<div>
43
43
+
<label for="days">number of days to ban for: </label>
44
44
+
<input type="text" name="days" id="days" />
45
45
+
</div>
46
46
+
<div>
47
47
+
<label for="reason">reason: </label>
48
48
+
<input type="text" name="reason" id="reason" />
49
49
+
</div>
50
50
+
<div>
51
51
+
<input type="submit" value="ban" />
52
52
+
</div>
53
53
+
</form>
54
54
+
</aside>
49
55
{/if}