<form id="user_edit_form" name="user" action="">
<input type="hidden" name="id" value="[%=user.id%]" id="users_id"/>
<div id="user_form_wrapper">

[%
var friendlyName=user.firstName+' '+user.lastName;
if (user.firstName=='' && user.lastName=='') friendlyName=user.username;
%]
  <h2>Edit account details for [%=friendlyName%]</h2>
    
  <span class="Field MediumField">
    <label for="users_4_username" class="desc">Username <span class="req">*</span></label>
    <input type="text" name="username" value="[%=user.username%]" id="user_username"/>
  </span>

  <span class="Field MediumField "><label for="users_4_email" class="desc">Email <span class="req">*</span></label>
    <input type="text" name="email" value="[%=user.email%]" id="user_email"/>
  </span>
        
  <span class="Field MediumField">
    <label for="role">Role</label>
    <select name="role" id="role">
      <option value="USER" [%if(user.roles.name=='ROLE_USER'){%]selected="selected"[%}%]>User</option>
      <option value="ADMIN" [%if(user.roles.name=='ROLE_ADMIN'){%]selected="selected"[%}%]>Administrator</option>
    </select>  
  </span>
  
  <span class="Field MediumField">
    <label for="enabled">Enabled</label>
    <select name="enabled" id="enabled">
      <option value="true">Enabled</option>
      <option value="false" [%if(user.enabled=='false'){%]selected="selected"[%}%]>Disabled</option>
    </select>  
  </span>
  
  <span class="Field MediumField"><label for="users_4_email" class="desc">Password</label>
    <input type="password" name="password" value="" id="password"/>
  </span>

  <span class="Field MediumField"><label for="users_4_email" class="desc">Confirm Password</label>
    <input type="password" name="confirmPassword" value="" id="confirmPassword"/>
  </span>
  
  <p>Enter a password to set a new password, or leave blank to keep password unchanged.</p>
        
    </div>
    
    <div class="Pane">
      <h2>Optional information</h2>

      <span class="Field MediumField">
        <label for="users_4_firstName" class="desc">First name</label>
        <input type="text" name="firstName" value="[%=user.firstName%]" id="users_4_firstName"/>
      </span>
    
      <span class="Field MediumField">
        <label for="users_4_lastName" class="desc">Last name</label>
        <input type="text" name="lastName" value="[%=user.lastName%]" id="users_lastName"/>
      </span>

      <span class="Field MediumField">
        <label for="users_4_phoneNumber" class="desc">Phone Number</label>
        <input type="text" name="phoneNumber" value="[%=user.phoneNumber%]" id="users_phoneNumber"/>
      </span>
    
      <span class="Field MediumField">
        <label for="users_4_website" class="desc">Web-site or Blog</label>
        <input type="text" name="website" value="[%=user.website%]" id="users_website"/>
      </span>
      
      <span class="Field MediumField">
        <label for="users_4_openid" class="desc">OpenID</label>
        <input type="text" name="openid" value="[%=user.openid%]" id="users_openid"/>
      </span>
      
    </div>
      
<div class="Actions">
  <ul>
    <li><input type="button" id="update_user" name="action.update" value="action.update"/></li>
    <li><input type="button" id="cancel_update_user" name="action.cancel" value="action.cancel"/></li>
    <li><input type="button" id="delete_user" name="action.delete" value="action.delete"/></li>
  </ul>
</div>
</div>
</form>