<form method="post" action="/profile/1" onsubmit="return true;" name="profile/1" id="useredit">
	<input type="hidden" id="profile_1__method" value="put" name="_method"/>
	<h2 class="title">
	[%
	if(user.id==null){
		%]Create a new user[%
	}else{
		%]Editing [% %]  [%=user.username%][%
	}
	%]
	</h2>
	<span class="Field ClearedField">
		<span class="error"></span>
		<label class="desc" >Username <span class="req">*</span></label>
		[%
		if(user.id==null){
		%]
		<input type="text" class="noborder" id="username" value="[%=user.username%]" name="username"/>
		[%}else{%]
		<input type="text" class="noborder" id="username" value="[%=user.username%]" name="username" disabled="disabled"/>
		[%}%]
		
	</span>
	<span class="Field ClearedField">
		<span class="error"></span>
		<label class="desc" >First name</label> <input type="text" maxlength="30" id="firstName" value="[%=user.firstName%]" name="firstName">
	</span>
	<span class="Field ClearedField">
		<span class="error"></span>
		<label class="desc">Last name</label> <input type="text" id="lastName" value="[%=user.lastName%]" maxlength="30" name="lastName">
	</span>
	<span class="Field MediumField ClearedField">
		<span class="error"></span>
		<label class="desc" >Email <span class="req">*</span></label>
		<input type="text" id="profile_1_email" value="[%=user.email%]" name="email">
	</span>
	
	[%
	if(can_user_role_be_changed(user,this_user)){
	
	if(user_is_admin(user)){
	%]
	
	
	[%
	}else{
	%]
		<span class="Field HugeField inline">
			<input type="checkbox" name="make_admin" id="make_admin" class="Checkbox inline">

			<label >Make user an admin.</label>
		</span>
	[%	
	}
	}
	%]
	
	[%
	var _password_change=true;
	if(user.id==null){
		_password_change=false;
		%]
		<span class="Field HugeField inline" style="display:none;">
			<input type="checkbox" name="change_password" id="change_password" checked="checked" class="Checkbox inline"/>
		</span>
		[%
	}else{
		%]
		<span class="Field HugeField inline">
			
			<input type="checkbox" name="change_password" id="change_password" class="Checkbox inline"/>
			<label >Change the users password.</label>
		</span>
		[%	
	}
	
	
	var _hide='';
	if(_password_change){
		_hide='hide';
	}
	%]
	
	<div id="set_password" class="[%=_hide%]">
		<h2 class="title">
		[%
		if(user.id==null){
		%]
		Create Password
		[%}else{%]
		Change Password
		[%}%]
		</h2>
		<span class="Field ClearedField">
			<span class="error"></span>
			<label class="desc" for="password">Password</label>
			<input type="password" id="password" name="password"/>
		</span>
		<span class="Field ClearedField">
			<span class="error"></span>
			<label class="desc" for="password">Confirm password</label>
			<input type="password" id="passwordconfirm" name="passwordconfirm"/>
		</span>
	</div>
</form>