{#- My account, on one page: who I am to the others (my photo, my name, what I do and where), the language and time zone the site speaks to me in, the daily digest, my password; beside it, how the others see me. The address, which I sign in with, is shown and not changed here. Drawn in `mockups/templates/profile-edit.html`. -#} {% extends "ads_base.html" %} {% import "forum/_post_fields.html" as fields %} {% block page_title %}{{ _("My account") }}{% endblock %} {% block heading %}{{ _("My account") }}{% endblock %} {#- A select of the field's own choices. -#} {% macro select(field, label) %}
{{ fields.errors(field) }}
{% endmacro %} {#- A text field, its errors under it. -#} {% macro input(field, label, type="text", autocomplete=none, required=false, help=none) %} {% set described = ([field.id ~ "-help"] if help else []) + ([field.id ~ "-error"] if field.errors else []) %}
{% if help %}{{ help }}{% endif %} {{ fields.errors(field) }}
{% endmacro %} {% block body %}
{{ csrf.field() }}

{{ _("Who I am") }}

{{ m.avatar(user, "ads-avatar--lg") }}
{#- Sent as soon as it is picked (`widgets/image.js`). -#}
{% if user.has_photo %}{% endif %} {{ _("A square photo, in JPEG or PNG. Without one, your initials.") }} {{ fields.errors(form.photo) }}
{{ input(form.first_name, _("First name"), autocomplete="given-name", required=true) }} {{ input(form.last_name, _("Last name"), autocomplete="family-name", required=true) }} {{ input(form.job_title, _("Job title"), autocomplete="organization-title") }} {{ input(form.organization, _("Organization"), autocomplete="organization") }}
{{ _("Email address") }} {{ user.email }} {{ _("To sign in, and for the site's e-mails. To change it, ask an administrator.") }}

{{ _("Language and time") }}

{{ select(form.locale, _("Language")) }} {{ select(form.timezone, _("Time zone")) }}

{{ _("What I receive by e-mail") }}

{{ _("Password") }}

{{ input(form.password, _("New password"), "password", "new-password", help=_("At least 8 characters, with an upper case letter, a lower case letter and a digit. Leave it empty to keep yours.")) }} {{ input(form.confirm_password, _("The same, once more"), "password", "new-password") }}
{{ _("Cancel") }}
{% endblock %}