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

	<s:Push Id="search" Value="$param1" />

	<c:SwipeHorizontalLayout Id="swipe_layout" Index="1">

		<s:If Test="$HasMenu()">
			<s:Include File="\Components\SideMenu.xml"/>
		</s:If>

		<c:DockLayout>

			<s:If Test="$BackMenu()">
				<c:DockLayout CssClass="top_navigator">
					<c:DockLayout Id="btnBack" CssClass="btn_back" OnEvent="Back" OnClickAction="$DoBack()">
						<c:Image />
						<c:TextView Text="@back" />
					</c:DockLayout>
					<c:DockLayout Id="btnForward" CssClass="btn_forward" />
					<c:HorizontalLayout Id="titleForward">
						<c:TextView Text="@title" />
					</c:HorizontalLayout>
				</c:DockLayout>
			</s:If>
			<s:Else>
				<c:DockLayout CssClass="top_navigator">
					<c:DockLayout Id="btnMenu" CssClass="btn_menu" OnEvent="Back" OnClickAction="$OpenMenu($swipe_layout)">
						<c:Image CssClass="menuIcon" />
					</c:DockLayout>
					<c:DockLayout CssClass="btn_space" />
					<c:HorizontalLayout>
						<c:TextView Text="#clients#" />
					</c:HorizontalLayout>
				</c:DockLayout>
			</s:Else>
			<c:HorizontalLine />

			<c:DockLayout CssClass="search">
				<c:Button Id="btnSearch" Text="#search#" OnClickAction="$DoRefresh($edtSearch.Text)"></c:Button>
				<c:DockLayout>
					<c:Image />
					<c:EditText Id="edtSearch" Text="$search" Placeholder="#search#"></c:EditText>
				</c:DockLayout>
			</c:DockLayout>
			<c:HorizontalLine />

			<s:If Test="$CreateOutletEnabled()">
				<c:HorizontalLayout Id="btnAdd" CssClass="bottom_btn" OnClickAction="$DoAction(CreateOutlet)">
					<c:TextView Text="#add#"></c:TextView>
				</c:HorizontalLayout>
				<c:HorizontalLine CssClass="b_line" />
			</s:If>


			<c:ScrollView Id="grScrollView">

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

				<s:Iterator Id="outlet" Value="$GetOutlets($search)">

					<c:DockLayout CssClass="grid" OnClickAction="$AddGlobalAndAction($outlet.Id)">
						<s:If Test="$outlet.OutletStatus == 0">
							<c:Image CssClass="blue_mark" />
						</s:If>
						<s:If Test="$outlet.OutletStatus == 1">
							<c:Image CssClass="yellow_mark" />
						</s:If>
						<s:If Test="$outlet.OutletStatus == 2">
							<c:Image CssClass="y_blue_mark" />
						</s:If>
						<s:If Test="$outlet.OutletStatus == 3">
							<c:VerticalLayout CssClass="no_mark"></c:VerticalLayout>
						</s:If>
						<c:VerticalLayout>
							<c:TextView Text="$outlet.Description" CssClass="$outlet.Style"></c:TextView>
							<c:TextView Text="$outlet.Address" CssClass="description_row"></c:TextView>
						</c:VerticalLayout>
						<c:Image />
					</c:DockLayout>
					<c:HorizontalLine />

				</s:Iterator>

				<c:HorizontalLayout CssClass="end_of_block" />

			</c:ScrollView>

		</c:DockLayout>

	</c:SwipeHorizontalLayout>

</c:Screen>
