[%
 /* If the deal has no ID then it is new */
%]
<div class="deals-holder" style="display: block;">
	<div class="deals-card-panel">
		<div class="gen-toolbar toolbar">
			<ul id="general_toolbar">
				<li>
					<input id="save-deal-action" type="submit" value="save"/>
				</li>
				<li><span>or</span></li>
				<li>
					<a id="link-deal-cancel" href="#" title="Delete" name="link-deal-cancel">cancel</a>
				</li>
				<li class="the-progress-indicator ">
					<span>Saving...</span><span class="ajaxLoading">&nbsp;</span>
				</li>
			</ul><span class="contact-name">[%
			if(deal.id==null){
				%]Create your new deal...[%
			}else{
				%]Editing "[%=deal.name%]"[%
			}
			%]</span>
		</div>
	</div>
	<div id="deals-NT" class="deals-inedit-pane">
		<div class="" id="contact-edit-form">
	    <form action="${ctx}/snippets/contacts/${contact.id}" method="post">
	        <input type="hidden" name="_method" value="put"/>
	        <div class="field-block" style="border-top:none">
	            <span class="Field MediumField Cleared">
	                <label>Name of Deal</label>
	                <input maxlength="50" type="text" value="[%=deal.name%]" name="name"/>
	            </span>

	            <span class="Field Cleared MediumField">
	                <label>Description of Deal</label>
	                <textarea name="description">[%=deal.description%]</textarea>
	            </span>
				
				<span class="Field Cleared">
					<label>Assigned To</label>
					<select name="assignedTo">
						[%					    
							$.each(users,function(uindex,user){
								if(user.enabled=='true'){
						%]
							<option value="[%=user.id%]" [%if(deal.assignedTo==user.id){%]SELECTED[%}%]>[%=user_fullname(user)%]</option>
						[%	
					}
							});
						%]	
					</select>
					
					<input type="hidden" name="assigendToVisual" value="Mark Forster"/>
					<input type="hidden" name="_assigendTo" value=""/>
				</span>
	        </div>
			<hr/>
			<div>
				<span class="Field Cleared Currency">
	                <label>Value of this Deal</label>
					<input type="text" value="[%=deal.amount%]" name="amount"/>
	            </span>
				<span class="Field Cleared MediumField Slider">
					<label>Probability</label>
					<input type="hidden" name="probability" value="[%=deal.probability%]"/>
					<span class="field-wrapper">
						
						<div id="slider-range-min" rel="[%=deal.probability%]"></div>
						<span class="inner-label">[%=deal.probability%]%</span>
					</span>
	            </span>
	             <span class="Field Cleared">
                            <label>Expected Close Date</label>
                            <input type="text" name="expectedClose" value="[%=format_expectedClose(deal.expectedClose)%]"/>
                </span>
			</div>
		</form>
		
	</div>
	
</div>
