<?xml version="1.0" encoding="utf-8" ?>
<c:Screen xmlns:c="BitMobile.Controls" xmlns:s="BitMobile.ValueStack" StyleSheet="CreateOutlet.css">

	<s:Push Id="contractor" Value="$param1"></s:Push>
	<s:Push Id="single" Value="$param2"></s:Push>

	<c:DockLayout>

		<c:DockLayout CssClass="top_navigator">
			<c:DockLayout Id="btnBack" CssClass="btn_back" OnEvent="Back" OnClickAction="$SaveContractorAndBack($contractor)" SubmitScope="description;INN;KPP;phone_number;email">
				<c:Image />
				<s:If Test="$single">
					<c:TextView Text="@back" />
				</s:If>
				<s:Else>
					<c:TextView Text="#list#" />
				</s:Else>
			</c:DockLayout>
			<c:DockLayout Id="btnForward" CssClass="btn_forward" />
			<c:HorizontalLayout>
				<c:TextView Text="#contractor#" />
			</c:HorizontalLayout>
		</c:DockLayout>

		<c:HorizontalLine />

		<c:ScrollView Id="grScrollView">

			<c:HorizontalLayout CssClass="margin_top" />
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(legal_name, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#description#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.Description" Placeholder="—" CssClass="main_row" Id="description" Required="true"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.Description" CssClass="main_row" Id="description"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(legal_name, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#legal_name#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.LegalName" Placeholder="—" CssClass="main_row" Id="legal_name" />
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.LegalName" CssClass="main_row" Id="legal_name" />
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(legal_address, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#legal_address#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.LegalAddress" Placeholder="—" CssClass="main_row" Id="legal_address"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.LegalAddress" CssClass="main_row" Id="legal_address"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid">
				<c:VerticalLayout Id="ownership_vl" OnClickAction="$SelectOwnership($OwnershipType, $contractor)">
					<c:TextView Text="#ownership#" CssClass="description_row"></c:TextView>
					<s:If Test="$NotEmptyRef($contractor.OwnershipType)">
						<c:TextView Id="OwnershipType" Text="$TranslateString($contractor.OwnershipType.Description)" CssClass="main_row"/>
					</s:If>
					<s:Else>
						<c:TextView Id="OwnershipType" Text="—" CssClass="main_row"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(INN, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#inn#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.INN" Placeholder="—" Keyboard="numeric" CssClass="main_row" Id="INN" Mask="#inn_regexp#"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.INN" CssClass="main_row" Id="INN"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(KPP, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#kpp#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.KPP" Placeholder="—" Keyboard="numeric" CssClass="main_row" Id="KPP" Length="9" Mask="#kpp_regexp#"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.KPP" CssClass="main_row" Id="KPP"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:DockLayout CssClass="grid" OnClickAction="$FocusOnEditText1(phone_number, 1)">
				<c:HorizontalLayout CssClass="phone">
					<c:VerticalLayout  OnClickAction="$GetPhoneAndCall($contractor)"></c:VerticalLayout>
				</c:HorizontalLayout>
				<c:VerticalLayout CssClass="partialW">
					<c:TextView Text="#phone#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.PhoneNumber" Placeholder="—" Keyboard="phone" CssClass="main_row" Id="phone_number" Mask="#phone_regexp#"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.PhoneNumber" CssClass="main_row" Id="phone_number"/>
					</s:Else>
				</c:VerticalLayout>
			</c:DockLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(email, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#email#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.Email" Placeholder="—" CssClass="main_row" Keyboard="email" Id="email" Mask="#email_regexp#"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.Email" CssClass="main_row" Id="email" />
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="grid" OnClickAction="$FocusOnEditText1(website, 1)">
				<c:VerticalLayout>
					<c:TextView Text="#web_site#" CssClass="description_row"></c:TextView>
					<s:If Test="@DateAddTru == false">
						<c:EditText Value="$contractor.WebSite" Placeholder="—" CssClass="main_row" Id="website"/>
					</s:If>
					<s:Else>
						<c:TextView Text="$contractor.WebSite" CssClass="main_row" Id="website"/>
					</s:Else>
				</c:VerticalLayout>
			</c:HorizontalLayout>
			<c:HorizontalLine />

			<c:HorizontalLayout CssClass="end_of_block" />

		</c:ScrollView>

	</c:DockLayout>

</c:Screen>
