By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 user-settings.html

View raw Download
text/html • 6.73 kiB
HTML document, ASCII text
        
            
1
{% extends "default.html" %}
2
{% block title %}
3
{% trans %}User settings{% endtrans %}
4
{% endblock %}
5
{% block breadcrumbs %}
6
<li><a href="/settings">{% trans %}Settings{% endtrans %}</a></li>
7
{% endblock %}
8
{% block content %}
9
<x-frame style="--width: 768px;">
10
<x-vbox>
11
<h1>{% trans %}User settings{% endtrans %}</h1>
12
<article class="card">
13
<section class="card-main">
14
<h2>{% trans %}Basic information{% endtrans %}</h2>
15
<p>{% trans username=user.username %}Username: {{ username }}{% endtrans %}</p>
16
<x-buttonbox>
17
<a class="button" href="password">{% trans %}Change password{% endtrans %}</a>
18
</x-buttonbox>
19
</section>
20
</article>
21
<article class="card">
22
<section class="card-main">
23
<h2>{% trans %}Avatar{% endtrans %}</h2>
24
<x-vbox>
25
<label for="change-avatar" id="change-avatar-label" data-change-label="{% trans %}Change{% endtrans %}">
26
<img src="/info/{{ user.username }}/avatar" alt="{{ user.username }}" class="avatar" style="width: 100%;" id="avatarPreview">
27
</label>
28
<form method="post" enctype="multipart/form-data" action="/info/{{ user.username }}/avatar">
29
<input type="file" name="avatar" accept="image/*" style="display: none;" id="change-avatar" onchange="preview();">
30
<button type="submit">{% trans %}Update{% endtrans %}</button>
31
</form>
32
</x-vbox>
33
</section>
34
<script>
35
avatarPreview=document.getElementById("avatarPreview");
36
37
function preview() {
38
avatarPreview.src=URL.createObjectURL(event.target.files[0]);
39
}
40
</script>
41
</article>
42
<article class="card">
43
<section class="card-main">
44
<form method="post" action="profile">
45
<h2>{% trans %}Profile{% endtrans %}</h2>
46
<x-vbox>
47
<x-vbox class="nopad">
48
<label for="email">{% trans %}Email address{% endtrans %}</label>
49
<input id="email" name="email" type="email" value="{% if user.email %}{{ user.email }}{% endif %}">
50
</x-vbox>
51
<x-vbox class="nopad">
52
<label><input name="showmail" value="showmail" {% if user.show_mail %}checked{% endif %} type="checkbox">{% trans %}Show email on my profile{% endtrans %}</label>
53
</x-vbox>
54
<x-vbox class="nopad">
55
<label for="displayname">{% trans %}Friendly name{% endtrans %}</label>
56
<input id="displayname" name="displayname" value="{% if user.display_name %}{{ user.display_name }}{% endif %}" placeholder="{{ user.username }}">
57
</x-vbox>
58
<x-vbox class="nopad">
59
<label for="url">{% trans %}Link to your website{% endtrans %}</label>
60
<input id="url" name="url" value="{% if user.url %}{{ user.url }}{% endif %}" type="url">
61
</x-vbox>
62
<x-vbox class="nopad">
63
<x-hbox style="width: 100%; align-items: space-between;">
64
<x-vbox style="flex-grow: 1;" class="nopad">
65
<label for="company">{% trans %}Company or school{% endtrans %}</label>
66
<input id="company" name="company" value="{% if user.company %}{{ user.company }}{% endif %}">
67
</x-vbox>
68
<x-vbox style="flex-grow: 1;" class="nopad">
69
<label for="companyurl">{% trans %}Link to the company's website{% endtrans %}</label>
70
<input id="companyurl" name="companyurl" value="{% if user.company_url %}{{ user.company_url }}{% endif %}" type="url">
71
</x-vbox>
72
</x-hbox>
73
</x-vbox>
74
<x-vbox class="nopad">
75
<label for="location">{% trans %}Location{% endtrans %}</label>
76
<input id="location" name="location" value="{% if user.location %}{{ user.location }}{% endif %}" type="text">
77
</x-vbox>
78
<x-vbox class="nopad">
79
<label for="bio">{% trans %}Bio{% endtrans %}</label>
80
<textarea id="bio" name="bio" rows="4">{% if user.bio %}{{ user.bio }}{% endif %}</textarea>
81
</x-vbox>
82
<button type="submit">{% trans %}Update profile{% endtrans %}</button>
83
</x-vbox>
84
</form>
85
</section>
86
</article>
87
<article class="card">
88
<section class="card-main">
89
<form method="post" action="preferences">
90
<h2>{% trans %}Preferences{% endtrans %}</h2>
91
{% trans username=user.username %}You can change themes by going to <a href="/{{ username }}/.config">your configuration repository</a> and pushing a CSS file called <code>theme.css</code>.{% endtrans %}
92
<x-vbox>
93
<x-vbox class="nopad">
94
<label for="page_length">{% trans %}Default number of items to show in paginated lists{% endtrans %}</label>
95
<input id="page_length" name="page_length" type="number" value="{{ user.default_page_length }}" min="1" max="256">
96
</x-vbox>
97
<x-vbox class="nopad">
98
<label for="max_post_nesting">{% trans %}Maximum nesting level for forum replies{% endtrans %}</label>
99
<input id="max_post_nesting" name="max_post_nesting" type="number" value="{{ user.max_post_nesting }}" min="1" max="256">
100
</x-vbox>
101
<button type="submit">{% trans %}Update preferences{% endtrans %}</button>
102
</x-vbox>
103
</form>
104
</section>
105
</article>
106
</x-frame>
107
{% endblock %}
108