{# start {templatelocation} #}

{noscript}

<div id="pe_navbar" style="display:none">
{navbar}
</div>

<div id="pe_preview" class="jsenabled_hide" style="display:none;">
  <fieldset>
    <legend>{lang_preview_title}</legend>
    {preview}
  </fieldset>
</div>

<form action="{site_url}/usersettings.php" method="post" {enctype} id="profile" class="uk-form">

<div id="pe_namepass" class="jsenabled_show">
  <fieldset>
    <legend>{lang_name_legend}</legend>
    <div class="compact">
      <dl class="form_block">
        {username_option}
        <dt><label for="profile-fullname">{lang_fullname}</label></dt>
        <dd><input type="text" maxlength="80" value="{fullname_value}" name="fullname" id="profile-fullname" class="size7"{xhtml}></dd>
      </dl>
    </div>
  </fieldset>

  <fieldset>
    <legend>{lang_password_email_legend}</legend>

    <div class="linear">
      <div class="profile_notes uk-panel uk-panel-box">
        <div class="uk-panel-title">
          <i class="uk-icon-info-circle uk-text-primary"></i>
          <span>{lang_password_help_title}</span>
        </div>
        <div>{lang_password_help}</div>
        <div><span class="warningsmall"><strong>{lang_enter_current_password}</strong></span></div>
      </div>
    </div>

    <div class="compact">
      <dl class="form_block">
        {password_option}

        {resynch_option}

        <dt><label for="cooktime">{lang_cooktime} {lang_cooktime_tooltip}</label></dt>
        <dd>{cooktime_selector}</dd>
        <dd class="description" id="desc-profile-cooktime">{lang_cooktime_text}</dd>

        <dt><label for="profile-email">{lang_email}</label></dt>
        <dd><input type="text" maxlength="96" value="{email_value}" name="email" id="profile-email" class="size6" aria-describedby="desc-profile-email"{xhtml}></dd>
        <dd class="description" id="desc-profile-email">{lang_email_text}</dd>

        <dt><label for="profile-email_conf">{lang_email_conf}</label></dt>
        <dd><input type="text" maxlength="96" value="{email_value}" name="email_conf" id="profile-email_conf" class="size6"{xhtml}></dd>
        <dd class="description" id="desc-profile-email_conf">{lang_email_conf_text}</dd>

        {!if emailtoconfirm}
        <dt><label for="profile-email-verify">{lang_email_verify}</label></dt>
        <dd><em>{emailtoconfirm}</em> <input type="checkbox" name="delete_emailtoconfirm" id="delete_emailtoconfirm">{lang_email_verify_delete}</dd>
        <dd class="description" id="desc-email-verify">{lang_email_verify_msg}</dd>
        {!endif}

        {current_password_option}
      </dl>
    </div>
    {delete_account_option}
  </fieldset>

{!if enable_twofactorauth}
  <fieldset>
    <legend>{lang_tfa_two_factor_auth}</legend>

    <div class="compact">
      <div class="profile_notes uk-panel uk-panel-box">
        <div class="uk-panel-title">
          <i class="uk-icon-info-circle uk-text-primary"></i>
          <span>{lang_tfa_two_factor_auth}</span>
        </div>
        <ol>
          <li>{lang_tfa_help1}</li>
          <li>{lang_tfa_help2}</li>
          <li>{lang_tfa_help3}</li>
          <li>{lang_tfa_help4}</li>
          <li>{lang_tfa_help5}</li>
        </ol>
      </div>

      <dl class="form_block">
        <dt><label for="enable_tfa">{lang_enable_twofactorauth}</label></dt>
        <dd>
          {# id required to be enable_tfa for javascript #}
          <select name="enable_twofactorauth" id="enable_tfa">
            {enable_tfa_options}
          </select>
        </dd>

        <dt><label for="tfa_qrcode">{lang_tfa_qrcode}</label></dt>
        <dd>
          <a id="tfa_flip_qrcode" href="#">{lang_tfa_show_hide}</a><br{xhtml}>
          <img class="tfa" src="{qrcode_data}" alt="" id="tfa_qrcode"{xhtml}>
        </dd>

        <dt><label for="tfa_backup_code">{lang_tfa_backup_code}</label></dt>
        <dd>
          <ul>
            <li><a id="tfa_flip_backupcodes" href="#">{lang_tfa_show_hide}</a></li>
            <li><a id="tfa_download_backupcodes" href="{site_url}/usersettings.php?mode=download_backupcodes&amp;{token_name}={token_value}">{lang_tfa_download}</a></li>
            <li><a id="tfa_generate_backupcodes" href="{site_url}/usersettings.php?mode=generate_backupcodes&amp;{token_name}={token_value}" onclick="return window.confirm('{tfa_generate_confirm}');">{lang_tfa_new_backup_code}</a></li>
          </ul>

          <ul class="tfa" id="tfa_backupcodes">
            {backup_codes}
          </ul>
        </dd>
      </dl>
    </div>
  </fieldset>
{!endif}
</div>

<div id="pe_userinfo" class="jsenabled_hide">
  <fieldset>
    <legend>{lang_personal_info_legend}</legend>

    <div class="linear">
      <div class="profile_notes uk-panel uk-panel-box">
        <div class="uk-panel-title">
          <i class="uk-icon-info-circle uk-text-primary"></i>
          <span>{lang_userinfo_help_title}</span>
        </div>
        <div>{lang_userinfo_help}</div>
      </div>
    </div>

    <div class="compact">
      <dl class="form_block">
        <dt><label for="profile-homepage">{lang_homepage}</label></dt>
        <dd><input type="text" maxlength="96" value="{homepage_value}" name="homepage" id="profile-homepage" class="size7"  aria-describedby="desc-profile-homepage"{xhtml}></dd>
        <dd class="description" id="desc-profile-homepage">{lang_homepage_text}</dd>

        <dt><label for="profile-location">{lang_location}</label></dt>
        <dd><input type="text" maxlength="96" value="{location_value}" name="location" id="profile-location" class="size7" aria-describedby="desc-profile-location"{xhtml}></dd>
        <dd class="description" id="desc-profile-location">{lang_location_text}</dd>

        {userphoto_option}

        <dt><label for="profile-postmode">{lang_postmode}</label></dt>
        <dd>
          <select id="profile-postmode" name="postmode">
            <option value="plaintext"{plaintext_selected}>{lang_plaintext}</option>
            <option value="html"{html_selected}>{lang_html}</option>
          </select>
        </dd>
        <dd class="description" id="desc-profile-postmode">{lang_postmode_text}</dd>

        <dt><label for="profile-sig">{lang_signature}</label></dt>
        <dd><textarea cols="45" rows="4" name="sig" id="profile-sig" class="wide" aria-describedby="desc-profile-sig">{signature_value}</textarea></dd>
        <dd class="description" id="desc-profile-sig">{lang_signature_text}</dd>

        <dt><label for="profile-about">{lang_about}</label></dt>
        <dd><textarea cols="45" rows="6" name="about" id="profile-about" class="wide" aria-describedby="desc-profile-about">{about_value}</textarea></dd>
        <dd class="description" id="desc-profile-about">{lang_about_text}</dd>

        <dt><label for="profile-pgpkey">{lang_pgpkey}</label></dt>
        <dd><textarea cols="45" rows="6" name="pgpkey" id="profile-pgpkey" class="wide" aria-describedby="desc-profile-pgpkey">{pgpkey_value}</textarea></dd>
        <dd class="description" id="desc-profile-pgpkey">{lang_pgpkey_text}</dd>

        {display_fields}
      </dl>
    </div>
  </fieldset>
</div>

{prefs}

<div id="save_button" class="submit">
  <input type="hidden" name="uid" value="{uid_value}"{xhtml}>
  <input type="hidden" name="mode" value="saveuser"{xhtml}>
  <input type="hidden" name="username" value="{username_value}"{xhtml}>
  <button type="submit" name="btnsubmit" value="{lang_submit}" class="uk-button uk-button-primary">{lang_submit}</button>
  <button type="submit" name="btncancel" value="{lang_cancel}" class="uk-button">{lang_cancel}</button>
</div>

</form>

<!-- BEGIN display_field_text -->
        <dt><label for="profile-{fieldname}">{lang_field}</label></dt>
        <dd><textarea cols="45" rows="4" name="{fieldname}" id="profile-{fieldname}" class="wide" aria-describedby="desc-profile-{fieldname}">{signature_value}</textarea></dd>
        {!if lang_field_text}
        <dd class="description" id="desc-profile-{fieldname}">{lang_field_text}</dd>
        {!endif}
<!-- END display_field_text -->

<!-- BEGIN display_field -->
        <dt><label for="profile-{fieldname}">{lang_field}</label></dt>
        <dd><input type="text" maxlength="{fieldmaxlength}" value="{field}" name="{fieldname}" id="profile-{fieldname}" class="size7" aria-describedby="desc-profile-{fieldname}"{xhtml}></dd>
        {!if lang_field_text}
        <dd class="description" id="desc-profile-{fieldname}">{lang_field_text}</dd>
        {!endif}
<!-- END display_field -->

{# end {templatelocation} #}
