a mini social media app for small communities
1@include 'partial/header.html'
2
3@if ctx.is_logged_in()
4<h1>user settings:</h1>
5
6<form action="/api/user/set_bio" method="post">
7 <label for="bio">bio:</label>
8 <br>
9 <textarea
10 name="bio"
11 id="bio"
12 cols="30"
13 rows="10"
14 minlength="@app.config.user.bio_min_len"
15 maxlength="@app.config.user.bio_max_len"
16 required aria-required
17 >@user.bio</textarea>
18 <br>
19 <input type="submit" value="save">
20</form>
21
22<hr>
23
24<form action="/api/user/set_pronouns" method="post">
25 <label for="pronouns">pronouns:</label>
26 <input
27 type="text"
28 name="pronouns"
29 id="pronouns"
30 minlength="@app.config.user.pronouns_min_len"
31 maxlength="@app.config.user.pronouns_max_len"
32 pattern="@app.config.user.pronouns_pattern"
33 value="@user.pronouns"
34 required aria-required
35 >
36 <input type="submit" value="save">
37</form>
38
39<hr>
40
41<form action="/api/user/set_nickname" method="post">
42 <label for="nickname">nickname:</label>
43 <input
44 type="text"
45 name="nickname"
46 id="nickname"
47 pattern="@app.config.user.nickname_pattern"
48 minlength="@app.config.user.nickname_min_len"
49 maxlength="@app.config.user.nickname_max_len"
50 value="@{user.nickname or { '' }}"
51 required aria-required
52 >
53 <input type="submit" value="save">
54</form>
55
56<form action="/api/user/set_nickname" method="post">
57 <input type="submit" value="reset nickname">
58</form>
59
60@if app.config.instance.allow_changing_theme
61<hr>
62
63<form action="/api/user/set_theme" method="post">
64 <label for="url">theme:</label>
65 <input type="url" name="url" id="url" value="@{user.theme or { '' }}">
66 <input type="submit" value="save">
67</form>
68@end
69
70<hr>
71
72<form action="/api/user/set_username" method="post">
73 <label for="new_username">username:</label>
74 <input
75 type="text"
76 name="new_username"
77 id="new_username"
78 pattern="@app.config.user.username_pattern"
79 minlength="@app.config.user.username_min_len"
80 maxlength="@app.config.user.username_max_len"
81 value="@{user.username}"
82 required aria-required
83 >
84 <input type="submit" value="save">
85</form>
86
87<hr>
88
89<details>
90 <summary>dangerous settings (click to reveal)</summary>
91
92 <details>
93 <summary>change password (click to reveal)</summary>
94 <form action="/api/user/set_password" method="post">
95 <p>changing your password will log you out of all devices, so you will need to log in again after changing it.</p>
96 <label for="current_password">current password:</label>
97 <input
98 type="password"
99 name="current_password"
100 id="current_password"
101 pattern="@app.config.user.password_pattern"
102 minlength="@app.config.user.password_min_len"
103 maxlength="@app.config.user.password_max_len"
104 required aria-required
105 autocomplete="off" aria-autocomplete="off"
106 >
107 <label for="new_password">new password:</label>
108 <input
109 type="password"
110 name="new_password"
111 id="new_password"
112 pattern="@app.config.user.password_pattern"
113 minlength="@app.config.user.password_min_len"
114 maxlength="@app.config.user.password_max_len"
115 required aria-required
116 autocomplete="off" aria-autocomplete="off"
117 >
118 <input type="submit" value="save">
119 </form>
120 </details>
121
122 <details>
123 <summary>account deletion (click to reveal)</summary>
124 <form action="/api/user/delete" autocomplete="off">
125 <input
126 type="number"
127 name="id"
128 id="id"
129 value="@user.id"
130 required aria-required
131 readonly aria-readonly
132 hidden aria-hidden
133 >
134 <p><strong>there is NO GOING BACK after deleting your account.</strong></p>
135 <p><strong>EVERY ONE of your posts, notifications, likes, dislikes, and ALL OTHER USER DATA WILL BE PERMANENTLY DELETED</strong></p>
136 <div>
137 <input type="checkbox" name="are-you-sure" id="are-you-sure" required aria-required>
138 <label for="are-you-sure">click to confirm</label>
139 </div>
140 <br>
141 <div>
142 <input type="checkbox" name="are-you-really-sure" id="are-you-really-sure" required aria-required>
143 <label for="are-you-really-sure">click to doubly confirm</label>
144 </div>
145 <br>
146 <div>
147 <input type="checkbox" name="are-you-absolutely-sure" id="are-you-absolutely-sure" required aria-required>
148 <label for="are-you-absolutely-sure">click to triply confirm</label>
149 </div>
150 <br>
151 <details>
152 <summary>(click to reveal deletion button)</summary>
153 <input type="submit" value="delete your account">
154 </details>
155 </form>
156 </details>
157</details>
158
159@else
160<p>uh oh, you need to be logged in to view this page!</p>
161@end
162
163@include 'partial/footer.html'