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="url" name="url" id="url" value="@user.theme"> 71 <input type="submit" value="save"> 72</form> 73@end 74 75<hr> 76 77<form action="/api/user/set_username" method="post"> 78 <label for="new_username">username:</label> 79 <input 80 type="text" 81 name="new_username" 82 id="new_username" 83 pattern="@app.config.user.username_pattern" 84 minlength="@app.config.user.username_min_len" 85 maxlength="@app.config.user.username_max_len" 86 value="@{user.username}" 87 required aria-required 88 > 89 <input type="submit" value="save"> 90</form> 91 92<hr> 93 94<form action="/api/user/set_automated" method="post"> 95 <label for="is_automated">is automated:</label> 96 <input 97 type="checkbox" 98 name="is_automated" 99 id="is_automated" 100 value="true" 101 @if user.automated 102 checked aria-checked 103 @end 104 > 105 <input type="submit" value="save"> 106 <p>automated accounts are primarily intended to tell users that this account makes posts automatically.</p> 107 <p>it will also hide most front-end interactions since the user of this account likely will not be using those very often.</p> 108</form> 109 110<hr> 111 112<details> 113 <summary>dangerous settings (click to reveal)</summary> 114 115 <br> 116 117 <details> 118 <summary>change password (click to reveal)</summary> 119 <form action="/api/user/set_password" method="post"> 120 <p>changing your password will log you out of all devices, so you will need to log in again after changing it.</p> 121 <label for="current_password">current password:</label> 122 <input 123 type="password" 124 name="current_password" 125 id="current_password" 126 pattern="@app.config.user.password_pattern" 127 minlength="@app.config.user.password_min_len" 128 maxlength="@app.config.user.password_max_len" 129 required aria-required 130 autocomplete="off" aria-autocomplete="off" 131 > 132 <br> 133 <label for="new_password">new password:</label> 134 <input 135 type="password" 136 name="new_password" 137 id="new_password" 138 pattern="@app.config.user.password_pattern" 139 minlength="@app.config.user.password_min_len" 140 maxlength="@app.config.user.password_max_len" 141 required aria-required 142 autocomplete="off" aria-autocomplete="off" 143 > 144 <input type="submit" value="save"> 145 </form> 146 </details> 147 148 <br> 149 150 <details> 151 <summary>account deletion (click to reveal)</summary> 152 <form action="/api/user/delete" autocomplete="off"> 153 <input 154 type="number" 155 name="id" 156 id="id" 157 value="@user.id" 158 required aria-required 159 readonly aria-readonly 160 hidden aria-hidden 161 > 162 <p><strong>there is NO GOING BACK after deleting your account.</strong></p> 163 <p><strong>EVERY ONE of your posts, notifications, likes, dislikes, and ALL OTHER USER DATA WILL BE PERMANENTLY DELETED</strong></p> 164 <div> 165 <input type="checkbox" name="are-you-sure" id="are-you-sure" required aria-required> 166 <label for="are-you-sure">click to confirm</label> 167 </div> 168 <br> 169 <div> 170 <input type="checkbox" name="are-you-really-sure" id="are-you-really-sure" required aria-required> 171 <label for="are-you-really-sure">click to doubly confirm</label> 172 </div> 173 <br> 174 <div> 175 <input type="checkbox" name="are-you-absolutely-sure" id="are-you-absolutely-sure" required aria-required> 176 <label for="are-you-absolutely-sure">click to triply confirm</label> 177 </div> 178 <br> 179 <details> 180 <summary>(click to reveal deletion button)</summary> 181 <input type="submit" value="delete your account"> 182 </details> 183 </form> 184 </details> 185</details> 186 187@else 188<p>uh oh, you need to be logged in to view this page!</p> 189@end 190 191@include 'partial/footer.html'