user_edit.jinja 1.74 KB
Newer Older
1
{% extends "core/user_base.jinja" %}
Skia's avatar
Skia committed
2

Skia's avatar
Skia committed
3
4
5
6
{% block title %}
{% trans %}Edit user{% endtrans %}
{% endblock %}

7
{% block infos %}
Skia's avatar
Skia committed
8
<h2>{% trans %}Edit user profile{% endtrans %}</h2>
9
<form action="" method="post" enctype="multipart/form-data" id="user_edit">
Skia's avatar
Skia committed
10
    {% csrf_token %}
11
12
13
14
    {% for field in form %}
    <p>{{ field.errors }}<label for="{{ field.name }}">{{ field.label }}
    {%- if field.name == "profile_pict" and form.instance.profile_pict -%}
    <br>{% trans %}Current profile: {% endtrans %}
15
    <img src="{{ form.instance.profile_pict.get_download_url() }}" title="{% trans %}Profile{% endtrans %}" /><br>
16
17
    {%- elif field.name == "avatar_pict" and form.instance.avatar_pict -%}
    <br>{% trans %}Current avatar: {% endtrans %}
18
    <img src="{{ form.instance.avatar_pict.get_download_url() }}" title="{% trans %}Avatar{% endtrans %}" /><br>
19
20
    {%- elif field.name == "scrub_pict" and form.instance.scrub_pict -%}
    <br>{% trans %}Current scrub: {% endtrans %}
21
    <img src="{{ form.instance.scrub_pict.get_download_url() }}" title="{% trans %}Scrub{% endtrans %}" /><br>
22
23
    {%- endif %}</label> {{ field }}</p>
    {% endfor %}
Skia's avatar
Skia committed
24
    <p><input type="submit" value="{% trans %}Update{% endtrans %}" /></p>
25
26
27
28
29
30
    <p>{% trans %}Username: {% endtrans %}{{ form.instance.username }}</p>
    {% if form.instance.customer %}
    <p>{% trans %}Account number: {% endtrans %}{{ form.instance.customer.account_id }}</p>
    {% endif %}
    {% if form.instance == user %}
    <p><a href="{{ url('core:password_change') }}">{% trans %}Change my password{% endtrans %}</a></p>
Skia's avatar
Skia committed
31
    {% elif user.is_root %}
Skia's avatar
Skia committed
32
    <p><a href="{{ url('core:password_root_change', user_id=form.instance.id) }}">{% trans %}Change user password{% endtrans %}</a></p>
33
    {% endif %}
Skia's avatar
Skia committed
34
</form>
Skia's avatar
Skia committed
35
36
37
38
39
{% endblock %}