<%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'Login settings')}</h2>

    %if h.user.can_change_password(c.page_user):
    <fieldset>
      <legend>${_("Password")}</legend>
      <p class="info">${_("Select a new password or leave the fields blank to keep your old one.")}</p>
      <div class="input_wrapper">
        <label for="password_change">${_("Password:")}</label>
        <input type="password" name="password_change" autocomplete="off" />
      </div>
      <div class="input_wrapper">
        <label for="password_confirm">${_("Password (confirm):")}</label>
        <input type="password" name="password_confirm" autocomplete="off" />
      </div>
    </fieldset>
    %endif


    %if 'openid' in h.allowed_login_types():
    <fieldset>
      <legend><img src="/img/icons/openid_20.png" class="cd" /> ${_("OpenID")}</legend>
      <p class="info">${_("OpenID allows you to use a single login on many web sites.")}</p>
      %if not len(c.page_user.openids):
        <div class="infobox">
            ${_("There are no associated OpenIDs.")}
        </div>
      %else:
        <div class="input_wrapper">
          <table border="0" width="100%">
              %for openid in c.page_user.openids:
              <tr>
                  <td><code>${openid.identifier}</code></td>
                  <td><a href="/openid/revoke?id=${openid.id}&amp;${h.url_token()}">${_("remove")}</a></td>
              </tr>
              %endfor
          </table>
        </div>
      %endif
      <a class="add" href="/openid/connect">${_("Add OpenID")}</a>
    </fieldset>
    %endif

    ${components.savebox(cancel_url=None)}

</form>
</%block>
