a mini social media app for small communities
1@include 'partial/header.html'
2
3@if ctx.is_logged_in()
4<script src="/static/js/text_area_counter.js"></script>
5
6<h1>user settings:</h1>
7
8<form action="/api/user/set_bio" method="post">
9 <label for="bio">bio: (<span id="bio_chars">0/@{app.config.user.bio_max_len}</span>)</label>
10 <br>
11 <textarea
12 name="bio"
13 id="bio"
14 cols="30"
15 rows="10"
16 minlength="@app.config.user.bio_min_len"
17 maxlength="@app.config.user.bio_max_len"
18 >@user.bio</textarea>
19 <br>
20 <input type="submit" value="save">
21</form>
22
23<hr>
24
25<form action="/api/user/set_pronouns" method="post">
26 <label for="pronouns">pronouns: (<span id="pronouns_chars">0/@{app.config.user.pronouns_max_len}</span>)</label>
27 <input
28 type="text"
29 name="pronouns"
30 id="pronouns"
31 minlength="@app.config.user.pronouns_min_len"
32 maxlength="@app.config.user.pronouns_max_len"
33 pattern="@app.config.user.pronouns_pattern"
34 value="@user.pronouns"
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: (<span id="nickname_chars">0/@{app.config.user.nickname_max_len}</span>)</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 >
52 <input type="submit" value="save">
53</form>
54
55<form action="/api/user/set_nickname" method="post">
56 <input type="submit" value="reset nickname">
57</form>
58
59<script>
60 add_character_counter('bio', 'bio_chars', @{app.config.user.bio_max_len})
61 add_character_counter('pronouns', 'pronouns_chars', @{app.config.user.pronouns_max_len})
62 add_character_counter('nickname', 'nickname_chars', @{app.config.user.nickname_max_len})
63</script>
64
65@if app.config.instance.allow_changing_theme
66<hr>
67
68<form action="/api/user/set_theme" method="post">
69 <label for="url">theme:</label>
70 <input type="text" name="url" id="url" value="@user.theme">
71 <input type="submit" value="save">
72</form>
73
74<hr>
75
76<form action="/api/user/set_css" method="post">
77 <label for="css">custom css:</label>
78 <br>
79 <textarea type="text" name="css" id="css" style="font: monospace;">@user.css</textarea>
80 <input type="submit" value="save">
81</form>
82@end
83
84<hr>
85
86<form action="/api/user/set_username" method="post">
87 <label for="new_username">username:</label>
88 <input
89 type="text"
90 name="new_username"
91 id="new_username"
92 pattern="@app.config.user.username_pattern"
93 minlength="@app.config.user.username_min_len"
94 maxlength="@app.config.user.username_max_len"
95 value="@{user.username}"
96 required aria-required
97 >
98 <input type="submit" value="save">
99</form>
100
101<hr>
102
103<form action="/api/user/set_automated" method="post">
104 <div>
105 <label for="is_automated">is automated:</label>
106 <input
107 type="checkbox"
108 name="is_automated"
109 id="is_automated"
110 value="true"
111 @if user.automated
112 checked aria-checked
113 @end
114 >
115 </div>
116 <input type="submit" value="save">
117 <p>automated accounts are primarily intended to tell users that this account makes posts automatically.</p>
118 <p>it will also hide most front-end interactions since the user of this account likely will not be using those very often.</p>
119</form>
120
121<hr>
122
123<details>
124 <summary>dangerous settings (click to reveal)</summary>
125
126 <br>
127
128 <details>
129 <summary>change password (click to reveal)</summary>
130 <form action="/api/user/set_password" method="post">
131 <p>changing your password will log you out of all devices, so you will need to log in again after changing it.</p>
132 <label for="current_password">current password:</label>
133 <input
134 type="password"
135 name="current_password"
136 id="current_password"
137 pattern="@app.config.user.password_pattern"
138 minlength="@app.config.user.password_min_len"
139 maxlength="@app.config.user.password_max_len"
140 required aria-required
141 autocomplete="off" aria-autocomplete="off"
142 >
143 <br>
144 <label for="new_password">new password:</label>
145 <input
146 type="password"
147 name="new_password"
148 id="new_password"
149 pattern="@app.config.user.password_pattern"
150 minlength="@app.config.user.password_min_len"
151 maxlength="@app.config.user.password_max_len"
152 required aria-required
153 autocomplete="off" aria-autocomplete="off"
154 >
155 <input type="submit" value="save">
156 </form>
157 </details>
158
159 <br>
160
161 <details>
162 <summary>account deletion (click to reveal)</summary>
163 <form action="/api/user/delete" autocomplete="off">
164 <input
165 type="number"
166 name="id"
167 id="id"
168 value="@user.id"
169 required aria-required
170 readonly aria-readonly
171 hidden aria-hidden
172 >
173 <p><strong>there is NO GOING BACK after deleting your account.</strong></p>
174 <p><strong>EVERY ONE of your posts, notifications, likes, dislikes, and ALL OTHER USER DATA WILL BE PERMANENTLY DELETED</strong></p>
175 <div>
176 <input type="checkbox" name="are-you-sure" id="are-you-sure" required aria-required>
177 <label for="are-you-sure">click to confirm</label>
178 </div>
179 <br>
180 <div>
181 <input type="checkbox" name="are-you-really-sure" id="are-you-really-sure" required aria-required>
182 <label for="are-you-really-sure">click to doubly confirm</label>
183 </div>
184 <br>
185 <div>
186 <input type="checkbox" name="are-you-absolutely-sure" id="are-you-absolutely-sure" required aria-required>
187 <label for="are-you-absolutely-sure">click to triply confirm</label>
188 </div>
189 <br>
190 <details>
191 <summary>(click to reveal deletion button)</summary>
192 <input type="submit" value="delete your account">
193 </details>
194 </form>
195 </details>
196</details>
197
198@else
199<p>uh oh, you need to be logged in to view this page!</p>
200@end
201
202@include 'partial/footer.html'