OXYGENHUB
# bf3d07541368 oxygenhub / templates / settings.html
4.2 KiB · HTML · last changed Uploaded profile pictures and organisation logos: PNG, JPEG or WebP checked by content, cropped, scaled and re-encoded before storing, served at /avatar/{name} with the identicon as fallback, removable 1 month ago source blame history raw
1
{% extends "base.html" %}
2
{% import "settings_tabs.html" as t %}
3
{% block title %}Profile{% endblock %}
4
{% block tabs %}{% call t::tabs("profile") %}{% endblock %}
5
{% block content %}
6
<div class="head"><h1>Profile <small>{{ me.username }}</small></h1></div>
7
{% if let Some(n) = notice %}<p class="note">{{ n }}</p>{% endif %}
8
{% if let Some(e) = error %}<p class="error">{{ e }}</p>{% endif %}
9
<div class="sectioned">
10
<nav class="section-nav" aria-label="Sections">
11
  <a href="#profile">Profile</a>
12
  <a href="#picture">Picture</a>
13
  <a href="#appearance">Appearance</a>
14
  <a href="#password">Password</a>
15
</nav>
16
<div class="sections">
17
<form id="verify-email" method="post" action="/settings/email/verify" hidden><input type="hidden" name="_csrf" value="{{ shell.csrf }}"></form>
18
<form class="card" id="profile" method="post" action="/settings">
19
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
20
  <label for="display_name">Display name</label><input type="text" id="display_name" name="display_name" value="{{ me.display_name }}">
21
  <label for="email">Email</label><input type="email" id="email" name="email" value="{{ me.email }}">
22
  <p class="small mute">Your email is never shown on your profile. {% if me.email.is_empty() %}Add one to receive notification email and reset your password by email.{% else if me.email_verified %}<span class="sig sig-valid">✔</span> Verified.{% else %}<span class="sig sig-unsigned">○</span> Not verified yet{% if mail %}: use the link we sent, or <button type="submit" form="verify-email" class="linkish">send a new one</button>{% endif %}.{% endif %}</p>
23
  <label for="bio">Bio</label><textarea id="bio" name="bio" rows="3" maxlength="280">{{ me.bio }}</textarea>
24
  <label for="website">Website</label><input type="url" id="website" name="website" value="{{ me.website }}" placeholder="https://">
25
  <label for="location">Location</label><input type="text" id="location" name="location" value="{{ me.location }}" maxlength="80">
26
  <p class="small mute">Shown on <a href="/{{ me.username }}">your profile</a>, with a picture drawn from your username.</p>
27
  <button type="submit">SAVE</button>
28
</form>
29
<form class="card picture-card" id="picture" method="post" action="/settings/avatar" enctype="multipart/form-data">
30
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
31
  <h2>Picture</h2>
32
  <div class="picture-row">
33
    <img class="avatar xl" src="/avatar/{{ me.username }}?v={{ me.avatar }}" alt="Your picture" width="96" height="96">
34
    <div>
35
      <label for="picture-file">Upload a photo</label>
36
      <input type="file" id="picture-file" name="picture" accept="image/png,image/jpeg,image/webp">
37
      <p class="small mute">PNG, JPEG or WebP, up to 5 MiB. It is cropped to the middle square and resized to 400×400.{% if me.avatar.is_empty() %} Until then you have a picture drawn from your username.{% endif %}</p>
38
      <button type="submit" name="action" value="upload">UPLOAD</button>
39
      {% if !me.avatar.is_empty() %}<button type="submit" name="action" value="remove" class="danger-btn">REMOVE</button>{% endif %}
40
    </div>
41
  </div>
42
</form>
43
<form class="card" id="appearance" method="post" action="/settings/appearance">
44
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
45
  <h2>Appearance</h2>
46
  <fieldset class="choices">
47
    <legend class="small mute">Theme, remembered in this browser</legend>
48
    {% for (value, label) in themes %}
49
    <label class="choice"><input type="radio" name="theme" value="{{ value }}"{% if theme == *value %} checked{% endif %}> {{ label }}</label>
50
    {% endfor %}
51
  </fieldset>
52
  <button type="submit">SAVE</button>
53
</form>
54
<form class="card" id="password" method="post" action="/settings/password">
55
  <input type="hidden" name="_csrf" value="{{ shell.csrf }}">
56
  <h2>Change password</h2>
57
  <label for="current">Current password</label><input type="password" id="current" name="current" autocomplete="current-password" required>
58
  <label for="password">New password</label><input type="password" id="password" name="password" autocomplete="new-password" required minlength="10">
59
  <p class="small mute">Changing it signs out every other session.</p>
60
  <button type="submit">CHANGE PASSWORD</button>
61
</form>
62
</div>
63
</div>
64
{% endblock %}