<%inherit file="/user/settings.html" />
<%namespace name="forms" file="/forms.html"/>
<%namespace name="components" file="/components.html"/>


<%block name="settings_content">
${tiles.user.header(c.page_user)}
<form class="well" method="POST" enctype="multipart/form-data">

    <input type="hidden" name="_method" value="PUT" />

    ${h.field_token()|n}

    ${components.flashmessages()}

    <h2>${_(u'Personal settings')}</h2>

    ${forms.input(_("Display name"), 'display_name', help=_("You can chose which name other users see."), placeholder=c.page_user.user_name)}

    ${forms.select(_("Language"), 'locale', c.locales, help=_("Prefered user interface language"))}

    %if h.config.get_bool('adhocracy.enable_gender'):
    ${forms.select(_("Salutation"), 'gender', c.salutations, help=_("Select your prefered gender"))}
    %endif

    %if h.config.get_bool('adhocracy.use_avatars'):
    <fieldset class="logo">
        <%forms:input label="${_(u'Avatar')}" name="avatar" type="file" help="${_(u'Select a profile picture. The image should be square. If it is not it may be scaled accordingly.')}">
        </%forms:input>
        %if c.current_avatar:
        <div class="current">
            <img src="${c.current_avatar}" alt="${_('Current avatar')}" />
            <br />
            <input name="delete_avatar" type="button" value="${_('Delete current avatar')}" class="fake_submit"/>
        </div>
        %endif
    </fieldset>
    %endif

    <%forms:textarea label="${_('Short biography')}" name="bio" value=""
    help="${_('A bio will allow others to learn about you and perhaps even get you a few delegations.')}">
    ${components.formatting()}
    </%forms:textarea>

    %if h.config.get_bool('adhocracy.allow_organization'):
    ${forms.checkbox(_("I am an organisation"), '_is_organization')}
    %endif

    ${components.savebox(cancel_url=None)}

</form>
</%block>
