<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="OBJECT[@TYPE='SITE-USER']">
<script type="text/javascript" src="/js/Admin/SiteUsers.js?{$version}.{$build}"/>
<form name="objectFrom" method="post" onsubmit="return validateForm();">

<xsl:attribute name="action"><xsl:value-of select="/SITEBUILDER-PAGE/VIEW-CONTENT/@ACTION"/></xsl:attribute>

<input type="hidden" id="siteId" name="siteId" >
	<xsl:attribute name="value"><xsl:value-of select="@SITE-ID"/></xsl:attribute>
</input>

<input type="hidden" id="userId" name="userId" >
	<xsl:attribute name="value"><xsl:value-of select="@USER-ID"/></xsl:attribute>
</input>

<fieldset class="sb-form-fieldset">
	<legend><xsl:value-of select="@LOGIN-TITLE"/></legend>
	
	<table cellpadding="0" cellspacing="0" border="0" class="control-title-input">
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">name</xsl:with-param>
			<xsl:with-param name="require">true</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">email</xsl:with-param>
			<xsl:with-param name="require">true</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="PASSWORD-FORM"/>
	</table>
</fieldset>

<fieldset class="sb-form-fieldset">
	<legend><xsl:value-of select="@MAIN-TITLE"/></legend>
	<table cellpadding="0" cellspacing="0" border="0" class="control-title-input">
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">firstName</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">lastName</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">company</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">phoneNumber</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">address1</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">address2</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">city</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">state</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">country</xsl:with-param>
		</xsl:call-template>
		<xsl:call-template name="SITE-USER-FORM-ROW">
			<xsl:with-param name="name">zip</xsl:with-param>
		</xsl:call-template>
	</table>
</fieldset>
</form>

<xsl:call-template name="OK-CANCEL-BUTTONS">
	<xsl:with-param name="okAction">if(validateForm()){document.forms.objectFrom.submit();}</xsl:with-param>
	<xsl:with-param name="cancelAction">document.location.href="<xsl:value-of select="$baseUrl"/>/Admin/Site/User/List?siteId=<xsl:value-of select="@SITE-ID"/>";</xsl:with-param>
</xsl:call-template>
	
</xsl:template>


<xsl:template name="SITE-USER-FORM-ROW">
	<!--alphabet order-->
	<xsl:param name="name"/>
	<xsl:param name="require"/>
	
	<tr>
		<td class="title-block">
			<xsl:apply-templates select="CONTROL[@NAME=$name]" mode="label">
				<xsl:with-param name="require" select="$require"/>
			</xsl:apply-templates>
		</td>
		<td class="input-block">
			<xsl:apply-templates select="CONTROL[@NAME=$name]" mode="control">
				<xsl:with-param name="require" select="$require"/>
			</xsl:apply-templates>
		</td>
	</tr>
</xsl:template>

</xsl:stylesheet>